Sunday 28 October 2018

passing parameter to function?

i try to pass parameter to function below but it shows an error i dont know why it occurs<-----code example---->var x=123;var att = document.createAttribute("onclick");att.value = "fun(x)";var btn = document.createElement("BUTTON");var t = document.createTextNode(result[l].name);btn.setAttributeNode(att);btn.appendChild(t);function fun(result){console.log(result);}

Submitted October 28, 2018 at 12:20PM by mohamedimy

No comments:

Post a Comment