jquery 3 checkbox. Want to determine which of the checkboxes is clicked -
The jquery 3 checkbox is to determine which click is done in the checkbox.
Example given here
& lt; Input type = "checkbox" name = "sign []" id = "mark1" square = "symbol" value = "1" & gt; & Lt; Input type = "checkbox" name = "symbol []" id = "mark2" square = "symbol" value = "2" & gt; & Lt; Input type = "checkbox" name = "sign []" id = "mark2" square = "symbol" value = "3" & gt; Click (function (index) {warning (index); if ($ (this) .is (": check")) {warning ($ (this) .val () + 'if checked')}} $ (This). (Function () (warning ($ (this) .val () + 'click' ');});}) // $ ('. Icon '). Click (function (index) { I need alert (index); [object object] on the alert number of the button clicked
You can easily click to use:
$ (This). Index (); // or $ (this). Index () + 1; index <0> to start with <0> Note: index () is zero index based.
Comments
Post a Comment