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
147.9k
how to increase value of like when click button like runtime
Aug 6 2016 8:37 AM
Hi I create web page have input type text and button add
when write value of course name in text box and press click add button it added in table as following
course like dislike
c# 0 0 like dislike
What i need actually is when press click on like button increase value of 0 for like depend on how many time click i will press on button like
suppose i click like button 5 times click
it will start 1,2,until it reach to 5
c# 5 0 like dislike (press button like 5 times click)
my code as bellow
@{
Layout =
null
;
}
<!DOCTYPE html>
<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 = 0
var
z= 0;
$(
"#tb"
).append(
"<tr> <td>"
+ x +
"</td> <td>"
+ y +
"</td> <td>"
+ z +
"</td><td> <input type='button'class='c' value='Like'/></td><td> <input type='button' class='d' value='Dislike'/></td></tr>"
);
});
});
</script>
</head>
<body>
<div>
<input type=
"text"
name=
"txt1"
id=
"txt1"
/>
<input type=
"button"
id=
"btn"
value=
"add"
/>
<table>
<thead>
<tr>
<td>
Course
</td>
<td>
LikeAccount
</td>
<td>
DislikeAccount
</td>
<td>
</tr>
</thead>
<tbody id=
"tb"
></tbody>
</table>
</div>
</body>
</html>
Reply
Answers (
2
)
Display Indian currency format in jquery Data Table.
how to create data list as rows for more attributes by jquer