I want to achieve disable the first right click and then re-enable right click on the same page.
<script type="text/javascript">
var elements = document.getElementsByTagName("body");
for(var id = 0; id < elements.length; ++id) {
elements[id].oncontextmenu = null;
}
</script>
/* this code will re-enable the right click */
<html>
<body oncontextmenu="return false;">
<!-- This will disable right click -->
</body>
</html>