<input class='setupcheck' type='checkbox' data-x='xpslider'>
<input class='setupcheck' type='checkbox' data-x='xp323'>
<input class='setupcheck' type='checkbox' data-x='xp525'>
I need for each checkbox to create a variable named as its data('x')
and give it a value 1
if it is checked, else - value 0
;
Something like this:
$('.setupcheck').each(function(){
if ($(this).is(':checked')){
variable named $(this).data('x') = 1;
}
else{
variable named $(this).data('x') = 0;
}
}
});
Any help?