1
How do I make a javascript code to know which checkbox are selected and when finding, get the value data-id
his?
<input type="checkbox" data-id="1">
<input type="checkbox" data-id="2">
<input type="checkbox" data-id="3">
I need something like this:
s = '';
for (checkbox){
if (checkbok.checked) { s+= checkbox.data-id.val(); }
}
alert(s);
None of these questions has what you’re looking for?
– Woss
@Andersoncarloswoss I think we can solve yes, I’ll see if I make the adaptation here. Thank you
– Italo Rodrigo
@Italorodrigo js pure or jquery ?
– Wees Smith
@Weessmith can be jquery, I am importing the file . js
– Italo Rodrigo