I want my code to only peform the onlick() before a button is pressed. How can i remove the onclick() so that they dont pass anything
(remove onclick())
<button class="testclass" id="testid" onclick="test()">finish setup</button> (button to execute the removal of onclick())
I tried with
document.getElementById("boardsection1").removeAttribute("onclick")
however it did not affect anything
3
Answers
Assign
null
to theonclick
property: