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
Sharma Raushan
NA
527
15.2k
Find all input fields and add values (sum of quantity and price)
Nov 15 2020 3:23 AM
I have below HTML table, on Add to table click a new is added each time with price and quantity input fields, how to sum all on Sum() click.
<button onclick=
"AddToTable()"
>Add to Table</button>
<button onclick=
"Sum()"
>get Invoice</button>
<table id=
"table"
class
=
"table table-bordered"
>
<thead>
<tr>
<td>Quantity</td>
<td>Price</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
function AddToTable()
{
var trr = document.createElement(
"tr"
);
$(trr).append(
"<td>"
+
"<input type='text'/>"
+
"</td>"
).append(
"<td>"
+
"<input type='text'/>"
+
"</td>"
);
$(
"#table tbody"
).append(trr);
}
Reply
Answers (
1
)
Jquery dataTable get first row as serial number in Roman.
Jquery dataTable computed column.