This is my function and it should change the onClick attribute of the HTML input, but if I use
document.getElementById(\'buttonLED\'+id).onclick = \"writeLED
Well, just do this and your problem is solved :
document.getElementById('buttonLED'+id).setAttribute('onclick','writeLED(1,1)')
Have a nice day XD