Electron Javascript Html Why button don't do their thing? basic question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Electron Javascript Html Why button don't do their thing? basic question

Hello to all I said it is a Electron question, but is it more a Js/html question. I can't get to work buttons. I just can't get where the problem is. Thanks for the help! https://gist.github.com/8305528b3ac0f27c0bd24ae5e86e43a2

27th Jun 2021, 4:44 AM
sylvain Bilhaud
sylvain Bilhaud - avatar
3 Answers
0
Ok Just to let you know that I am trying hard also //btn.addEventListener ("click", function() {alert("did something");}); //btn.addEventListener("onclick", myScript); //btn.onclick = function(){myScript()}; //btn.addEventListener("click", function(){ alert("Hello World!"); }); btn.setAttribute("onclick", function myScript() { console.log("blablapppp"); }); None are giving me result, but the last at least appears in the DOM.
27th Jun 2021, 6:41 AM
sylvain Bilhaud
sylvain Bilhaud - avatar
0
Still mothing happening... btn.setAttribute("onclick", function dothat() { myScript(); });
27th Jun 2021, 7:01 AM
sylvain Bilhaud
sylvain Bilhaud - avatar
0
idinput=("input"+id).toString btn.setAttribute("onclick", myScript(document.getElementById(idinput).value));
27th Jun 2021, 7:30 AM
sylvain Bilhaud
sylvain Bilhaud - avatar