samedi 29 avril 2017

Call 2 JavaScript functions for one checkbox

I've got a little problem, my checkbox already has an ID, Name etc. attached to it, so I don't know how to link the JavaScript code below to the checkbox, because the ID and Name are already used. I already know that you cannot use multiple IDs, because it will then only use the first ID specified.

Any ideas how to fix this?

setTimeout(function(){
document.getElementById('checkboxdelay').checked = true;
},1000)
<input name="product" value="199" type="checkbox" id="p4" id="checkboxdelay" onChange="totalIt()"/>



Aucun commentaire:

Enregistrer un commentaire