How to use Contextmenu Attribute in HTML5

In this article I am going to explain about Contextmenu attribute in Html5.
  • 2535

Contextmenu Attribute in HTML5

Contextmenu attribute use for create context menu for any element in html document. Context menu appears when user right-click on an element. Contextmenu is new in HTML5.

Browser that supports Contextmenu Attribute

Contextmenu attribute is not currently supported in any browser

Syntax

<ElementName contextmenu="menuid">

Example

<html>

<body>

    <p contextmenu="menu">

        Rigt click for display contextmenu</p>

    <menu id="menu">

        <command label="Open">

  <command label="Edit" >

  <command label="Delete" >

  <command label="Rename" >

    </menu>

    <p>

        Contextmenu is not currentlly supported in any browser</p>

</body>

</html>

 

Output


contextmenu.jpg

Further Readings

You may also want to read these related articles: here
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 
© 2020 DotNetHeaven. All rights reserved.