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>