JQuery event click, jQuery event click
In asp.net or asp.net mvc, the object click event is one of the most commonly used events. It indicates that the user clicks the mouse button and releases the event.
Today is July November, and learning is a new start. There is no special situation in creating a new controller, NovemberController. cs. All the exercises of this month are executed on this controller.
A view Action Jqclick () is created ().
Demo:
Conflicts with click events of JQuery
Write your # OK and # close as the following: it should be the effect you want.
$ ("# OK"). click (function (){
$ (". Words"). show ()
$ (". Setting"). hide ()
$ ("# Change"). show ();
$ ("# OK"). hide ()
})
$ ("# Close"). click (function (){
$ (". Words"). show ();
$ (". Setting"). hide ()
$ ("# Change"). show ();
$ ("# OK"). hide ()
});
By the way, you can write two $ (# change). click values together.
Question about the jquery click Event
In the Event Callback Function of jQuery, this is the element that triggers the event, so you can use $ (this) to select the button yourself in the callback method.
For example, suppose you have a structure like this.
<Table id = "table"> <tr> <td> 1 </td> <a href = "" class = "button"> </a> </ td> </tr> <td> 2 </td> <a href = "" class = "button"> </a> </td> </tr> <td> 3 </td> <a href = "" class = "button"> </a> </td> </ tr> </table> if you want to delete the corresponding tr when you click a, you can write it like this.
$ (". Button"). click (function () {$ (this). closest ("tr"). remove ();});
Similarly, it is similar to searching for associated elements based on $ (this ).
In addition, the number of rows you mentioned can be processed in this way, also based on the above html
$ (". Button "). click (function () {var rowNumber = $ ("# table tr "). index ($ (this ). closest ("tr");}); in fact, it is the number of parent tr closest to the current button in all tr of the table.