How can not be obtained or the same class id values of the plurality of data values, this is the beginning of the use

Problem: Can not get in a scene id (id may be dynamic id) or the same class more than the value of data on how to take it to the value, expressed less clear about it this way.

use

$ (this) .val () you can get up to his values. 
My scenario is regardless of their id, or just click on the name is what I'll get to the current
output at a click event
console, log (this) is an input tag
and then
$ (this) .val () to get his value to the value, this is really a good thing, this should be good at using 


my source code
(to traverse out of its class are the same)
$(".checkvalue").click(function () {
// console.log("点击")
// console.log($(this).val());
if ($(this).val() == "0") {
$(this).val("1")
} else {
$(this).val("0")
}
})

Guess you like

Origin www.cnblogs.com/liglacier/p/11387104.html