mardi 26 mai 2015

Insert variables in jqery checkbox code

I have the following jquery code:

$("#MLSAreaMajor1").prop("checked", false);
$("#MLSAreaMajor2").prop("checked", false);
$("#MLSAreaMajor3").prop("checked", false);

I want to loop through this code and replace the MLSAreaMajor with a variable, the 1,2,3 after the MLSAreaMajor would be a variable based on loop number, and the false will also be a variable as it my say false or true.

I can't seem to get the correct syntax and have tried numerous things.

Thanks in advanced.




Aucun commentaire:

Enregistrer un commentaire