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>