0

I need trigger mouse right click using javascript or jQuery. Here I tried below code it is not working for me

 <div id="testing" style="height:500px;width:1000px;background-color:lime;"></div>
    <script>
   $(document).ready(function () {
     $('#testing').contextmenu();
     //or
     $('#testing').trigger({
        type: 'mousedown',
         which: 3
     });
    });
    </script>

can you please any provide information on this.

Artsrun Hakobyan
  • 112
  • 1
  • 3
  • 11
balachandar
  • 825
  • 4
  • 13
  • 5
    You can’t open context menus programmatically. – Ry- Jul 28 '17 at 05:57
  • 2
    Possible duplicate of [Programmatically Calling Browser Right-Click Menu Options?](https://stackoverflow.com/questions/1896362/programmatically-calling-browser-right-click-menu-options) – flygaio Jul 28 '17 at 06:00

1 Answers1

-1

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<div id="testing" style="height:500px;width:1000px;background-color:lime;"></div>
<script>
$(document).ready(function () {

$("#testing" ).contextmenu(function() {
  alert( "Right clicked" );
});

});
</script>