JSFiddle - React, Tailwind, and code Playground

by rjha999

HTML

<script src="http://medialize.github.com/jQuery-contextMenu/src/jquery.contextMenu.js"></script>
<link rel="stylesheet" href="http://medialize.github.com/jQuery-contextMenu/src/jquery.contextMenu.css">
    <div class="test">
    <strong>with data title</strong>
</div>

JavaScript

$(function(){
    $.contextMenu({
        selector: '.test',
        //className: 'data-title',
        callback: function(key, options) {
            var m = "clicked: " + key;
            //window.console && console.log(m) || alert(m);
            alert(key);
            
        },
        items: {
            "edit": {name: "Edit", icon: "edit"},
            "cut": {name: "Cut", icon: "cut"},
        }
    });
});
$('.data-title').attr('data-menutitle', "Hello World");