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
ahmed salah
NA
530
149.8k
Delete button no responding and not remove record
Jul 20 2016 1:56 PM
I try more time to delete record by jquery but no responding meaning nothing happen
my code as following
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script>
$(function () {
$("#btn").click(function ()
{
var x = $("#txt1").val();
var y = $("#txt2").val();
var z = $("#txt3").val();
$("#tb").append("<tr> <td>" + x + "</td> <td>" + y + "</td> <td>" + z + "</td><td> <input type='button'value='Delete'/></td><td> <input type='button'value='Edit'/></td></tr>");
});
$("#tb").on("click", ".c", function () {
$(this).parent().parent().remove();
});
});
</script>
</head>
<body>
<div>
ID<input type="text" id="txt1" /><br />
Name<input type="text" id="txt2" /><br />
Country<input type="text" id="txt3" /><br />
<input type="button" value="add" id="btn" />
<table id="tb">
<tr><td>ID</td><td>Name</td><td>Country</td><td><input type="button" class="c" value="Delete" /></td><td>Edit</td></tr>
</table>
</div>
</body>
</html>
what remaining in my code or wrong to button delete work
Reply
Answers (
1
)
onclick on tr row
How to add one row from two drop down to table and remove