it just doesn't error when i use only name=myCheckbox
function example(){
var arr = $.map($('input[name=myCheckbox]:checkbox:checked'), function (e, i) {
return +e.value;
});
return arr;
}
I need to use "id" in javascript. but I'm getting an error.
function example(id){
var arr = $.map($('input[name=myCheckbox'+id+']:checkbox:checked'), function (e, i) {
return +e.value;
});
return arr;
}
Uncaught Error: Syntax error, unrecognized expression: input[name=myCheckbox[object Object]]:checkbox:checked
How can I fix? Sorry my lang. Thank you..
Aucun commentaire:
Enregistrer un commentaire