<div class="codetitle"> <span><a style="CURSOR: pointer" data="46047" class="copybut" id="copybut46047" onclick="doCopy('code46047')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code46047"> <br>function $(id) { <br>return document.getElementById(id); <br>} <br>$('test').oncontextmenu=function() { return false; }; <br> </div> <br>这样就可以给指定的元素自定义右键菜单