Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

I need the HTML code that would disable the right click button when someone goes on my web site?

I have a lot of pictures and writings that I wish to put on a web site that I am going to make in Geocities. What I need is the HTML code that would disable the right click so no one could steal my pics or writings.

5 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    You disable the right click in JavaScript, not HTML. And it only works if JavaScript isn't disabled in the user's browser. And even then it doesn't protect your content anyway. If you don't want people saving your content, don't post it on the internet. If they can view it, the can save it.

  • 1 decade ago

    Hi,

    This is the code which when placed in <head> section.

    No right click for Images -

    <script language="JavaScript">

    <!-- var popup="Sorry, right-click

    is disabled.\n\nThis Site Copyright ©2000"; function noway(go) { if

    (document.all) { if (event.button == 2) { alert(popup); return false; } } if (document.layers)

    { if (go.which == 3) { alert(popup); return false; } } } if (document.layers)

    { document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=noway; // -->

    </script>

    No right click for source -

    <script language="JavaScript1.1">

    <!-- var debug = true; function

    right(e) { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which

    == 2)) return false; else if (navigator.appName == 'Microsoft Internet Explorer'

    && (event.button == 2 || event.button == 3)) { alert('This Page is fully

    protected!'); return false; } return true; } document.onmousedown=right; if (document.layers)

    window.captureEvents(Event.MOUSEDOWN); window.onmousedown=right; //--></script>

    I hope this helps. However there are tremendous ways to copy content from your website in anycase.

    But I belive this is what you were looking for.

    Regards.

  • ?
    Lv 4
    5 years ago

    there is not any CSS code purely html, and it relies upon on the browser you're making use of. attempt firefox and upload the cyber web developer plugin and firebug. Its sensible on doing this form of ingredient you desire

  • 1 decade ago

    HI,

    If u use dreamweaver to design you can disable your mouse through the "Behaviours" panel.

    Thanks

  • How do you think about the answers? You can sign in to vote the answer.
  • 1 decade ago

    simple copy and paste the following code in your body section of the page.... right click will be disable automatically.

    <script language=JavaScript>

    var message="Function Disabled!";

    ///////////////////////////////////

    function clickIE4(){

    if (event.button==2){

    alert(message);

    return false;

    }

    }

    function clickNS4(e){

    if (document.layers||document.getElementById&&!document.all){

    if (e.which==2||e.which==3){

    alert(message);

    return false;

    }

    }

    }

    if (document.layers){

    document.captureEvents(Event.MOUSEDOWN);

    document.onmousedown=clickNS4;

    }

    else if (document.all&&!document.getElementById){

    document.onmousedown=clickIE4;

    }

    document.oncontextmenu=new Function("alert(message);return false")

    // -->

    </script>

Still have questions? Get your answers by asking now.