lundi 15 janvier 2018

checkbox.onclick IE8 issue with dynamic variable in a function

i have an issue with the onclick attribute on a checkbox.

All i have to do is assign a function to a checkbox when is clicked.

By pressing a button i can create dinamically checkboxes and assign them the functions RDescTec(N1,C1,this); RDescTec(N2,C2,this); RDescTec(N3,C3,this); and so on.

So i've written this :

chk.setAttribute( "onclick", "RDescTec(N"+conTab+",C"+conTab+",this);");

and

chk.onfocus = function() {RDescTec(N+conTab+,C+conTab+,this);}; \ Not sure of this one

Some suggested this:

chk.onclick = doSomething;

but if i insert the remaing part of the function it doesn't work.

Sorry for my English




Aucun commentaire:

Enregistrer un commentaire