Edit in JSFiddle

$(document).ready(function () {
    var liCount = 1;
    $(".parent").jQContextMenu({
        selector: ".showMenu",
        target: "#menu",
                beforeContextMenu: function (context, e) {
                    var element = $(e.element);
                    var editLi = $("li:contains('Edit')", element);
                    var optionsLi = $("li:contains('Other Options')", element);

                    if (context[0].id == "contentDiv1") {
                        //Removing an exsisting menu item.
                        element.find('.dynamicLi').remove();
                        //Adding a new menu item.
                        element.append("<li class='dynamicLi'>Dynamic Item " + liCount + "</li>");

                        //Disabling specific menu item.
                        if (!editLi.hasClass('ui-state-disabled'))
                            editLi.addClass('ui-state-disabled');

                        //Hiding an menu item.
                        if (optionsLi.css('display') != 'none')
                            optionsLi.css('display', 'none');

                        e.refresh();
                        liCount++;
                    }
                    else
                    {
                        element.find('.dynamicLi').remove();
                        //Enabling specific menu item.
                        if (editLi.hasClass('ui-state-disabled'))
                            editLi.removeClass('ui-state-disabled');

                        //Showing an menu item.
                        if (optionsLi.css('display') == 'none')
                            optionsLi.css('display', 'list-item');
                    }
                },
                itemClick: function (event, ui) {
                    var text = $(ui.items[0]).text();
                    if (event[0].id == "contentDiv1")
                        alert("You clicked on " + text + " in DIV " + 1);
                    else
                        alert("You clicked on " + text + " in DIV " + 2);
                }
    });
});
<div class="parent" style="z-index:20; color:white;  margin-left:20%; margin-right:20% ">
   <span style="color:#4E4D4D; font-size:24px; font-family:Segoe UI;">Add & Remove MenuItem Dynamically</span>

        <div style="color:#4E4D4D; font-size:24px; margin-top:30px; font-family:Segoe UI;">DIV 1</div>
        <div class="showMenu" id="contentDiv1" style="margin-top:5px; padding: 60px 60px 60px 120px; background-color:rgb(163, 163, 163); font-size:25px;">Right Click here to Show Context Menu</div>
        <div style="color:#4E4D4D; font-size:24px; margin-top:30px; font-family:Segoe UI;">DIV 2</div>
        <div class="showMenu" id="contentDiv2" style="margin-top:5px; padding: 60px 60px 60px 120px; background-color:rgb(163, 163, 163); font-size:25px;">Right Click here to Show Context Menu</div>

        <div  style="color:#4E4D4D; margin-top:50px; font-size:18px; font-family:Segoe UI;">This sample illustrates how to Add, Remove, Disable and Hide menuItems Dynamically</div>

 </div>
    <ul id="menu">
       <li><span class="ui-icon ui-icon-scissors"></span>Cut</li>
         <li><span class="ui-icon ui-icon-copy"></span>Copy</li>
        <li><span class="ui-icon ui-icon-copy"></span>Paste</li>
        <li>-----</li>
        <li>Edit</li>
        <li>Other Options<ul><li>Option1</li><li>Option2</li></ul></li>
    </ul>
<br/>
<p><font size="3"><b>Source for this<a  target="_blank"href="http://jqfaq.com/jquery-ui-context-menu-plugin/"</a> JQFaq Question</b></font></p>
    <iframe id="iframe1" src="http://jqfaq.com/AdPage.html" style="width:100%;border:none;" />

              
            
          
            
              

External resources loaded into this fiddle: