Even if JavaScript is banned, these right -click menus can still be displayed normally. Therefore, if you want to respect the user's choice, the best way is to use JavaScript to create these menu elements and inject it into the DOM element. In this way, when JavaScript is banned, these right -click menus will not be displayed.
There is a good thing in the HTML5 specification that is ignored by everyone, that is, the right -click menu. Right -click menu specifications in HTML5 show that programmers can generate the right -click menu by creating simple HTML5MENU and Menuitem marks. The menu is only displayed in the right -click menu in the specified area. Therefore, you don't need to achieve this effect by creating a browser plug -in. Let me show how to use the basic HTML mark to create a personalized right -click menu!
HTML codeFirst of all, we define an HTML area to allocate it a ID. After that, we need to use this ID:
XML/HTML code Copy content to the clipboard