我想在右键单击我禁用右键菜单时附加上下文菜单的链接。这是我的代码:
<div class="container">
<div id="menu">
<a href="#" id="f12" value="123" onclick="return false;">inspect element</a>
</div>
</div>
<script>
$(document).bind("contextmenu", function(e){
$('#menu').css({
top: e.pageY+'px',
left: e.pageX+'px'
}).show();
$(document).click(function() {
$('#menu').hide();
});
return false;
});
$('#do').on("click", function(e){
var n = $('#do').val();
if(n == 123){}
e.keyCode; // i want to show inspector (console)
});
</script>