TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prakash
NA
258
77.8k
Dynamic generate id
Jul 29 2016 2:47 AM
Hello Experts,
i want to generate dynamic id for textbox and button.
$(document).ready(function () {
function addRow() {
var html = '<tr>' +
'<td><select id="txtName" class="form-control"><option> Select Product</option><option> VITA-H 100ml</option><option> CAL-CM GOLD</option></td>' +
'<td><input type="text" id="txtAmount" class="form-control" placeholder="Amount"></td>' +
'<td><input type="text" id="txtQyantity" class="form-control" placeholder="Qyantity" ></td>' +
'<td><input type="text" id="txtTotalAmount" class="form-control" placeholder="Total Amount"></td>' +
'<td><input type="button" id="btnadd" class="form-control btn btn-success" value="+ Add Product" /></td>' +
'<td><input type="button" id="btnremove" class="form-control btn btn-danger" value="- Remove Product" /></td>' +
'</tr>';
$(html).appendTo($("#Table1"));
};
/
$("#Table1").on("click", "#btnadd", addRow);
function deleteRow() {
var par = $(this).parent().parent();
par.remove();
};
};
});
when i click on "add product" button its add new row for product.But not getting different id for Textbox of new row.
Please help me.
Thank You
Reply
Answers (
7
)
How to hide all div's with same class name in a page?
Change Cell Content Salary Or Bonus change total same time