Saved X
Google login
SignUp with Email
X

Javascript event right click

theindreshverma ( Edited  Sep 29, 02:41 am )
Login

Html oncontextmenu method

<body oncontextmenu="menu()">

    <h2 align="center">Javascript event right click</h2>

    <p id="p" hidden>This is menu.</p>
    
</body>

<script>
function menu() {
    event.preventDefault();
    document.getElementById('p').style.display = 'block';
}
</script>

Sourcecode Tags

More Sourcecodes

More Sourcecodes