I found that code on internet and it works fine to create a button
document.write(nomedispositivo)
var r=$('<input/>').attr({//início botão
type: "button",
id: "field" ,
value: "Liga",
But if I insert the line: onclick:switchLED() where switchLED is a function the button not appear where is the problem?
document.write(nomedispositivo)
var r=$('<input/>').attr({//início botão
type: "button",
id: "field" ,
value: "Liga",
onclick:switchLED()
onclick:"switchLED()"