vendredi 24 juin 2016

How can I have a checkbox as selected in Javascript?

I have some items to be selected,they are checkboxes with their certain titles in a table. I want to onclick on an item(I mean each "td") then the function do its job but besides I want the checkbox of that selected "td" t be checked. How can I do it with javascript?

note:I am learning javascript so please don't answer with a jquery solution. the code below is an example of each items

<td id="1" onclick="chb('1')" ><input  type="checkbox" />title</td>




Aucun commentaire:

Enregistrer un commentaire