I want my code to only peform the onlick
before a button is pressed. How can I remove the onclick
so that they don't pass anything?
<!-- remove onclick -->
<div class="boardsection2" id="2_8_7" onclick="divclick('2_8_7')"></div>
<!-- button to execute the removal of onclick -->
<button class="testclass" id="testid" onclick="test()">finish setup</button>
I tried with
document.getElementByClassName("boardsection1").removeAttribute("onclick")
but it did not affect anything.