showing results for - "html button click only once"
Martina
02 Mar 2019
1<script>
2function doSomething () {
3  // Remove onclick
4  var element = document.getElementById("myDiv");
5  element.onclick = "";
6
7  // Do your processing here
8  alert("Something is done!");
9
10  // Re-enable after processing if you want
11  // element.onclick = doSomething;
12}
13</script>
14
15<div id="myDiv" onclick="doSomething()">
16  Click Here To Do Something
17</div>
queries leading to this page
how to make a button only clickable oncehow to make button only clickable oncehow to make button click only once in htmlonclick only onceevent onclick only once in html w3schoolscan only click some of button javascriptmake only click one button at once in htmlwht is one click in jsmake button clickable only oncebutton can only click oncejs button click only oncejavascript nake button only click onceclick only one time a button using javascriptcan click button only once javascriptjs onclick only oncebutton can only click once htmlbutton is clickable only oncehtml can only click button oncejavascript button click only onceclick button only oncehow to button only click oneable to press button once javascriptbutton clickable onceonclick execute oncejavascript on click just oncehtml button click only oncehow to make a button only be clicked oncehow to make click button fire only oncemake a button only clickable once jshow to only let a button get clicked once in jqueryhow to only allow a button to show at a certain functionhow to click button oncebutton onclick works only oncehtml onclick trigger only oncebutton can only click once w3button onclick only onceclick only once buttonbutton click once javascripthtml button clickable only one timebutton onclick only works oncemake button only clickable oncebutton click only one timehow to make button click only once in javascriptmake button click oncehtml button only click oncebutton click only once javascriptjavascript click button just oncehtml button just click oncejs click button only onceonly one clickhtml button click only once