我想在html頁面上繪製單元格,其中每個單元格都是DIV,我需要能夠捕獲任何這些單元格上的右鍵單擊事件,我該怎麼做?捕獲右鍵單擊HTML DIV
<script>
function fn(event)
{
alert('hello'+event.button);
}
</script>
<div id="cell01"
class=""
onclick="fn(event);"
style="left: 1471px; width: 24px; height: 14px; top: 64px; text-align: center; position: absolute; background-color: rgb(128, 128, 0);">1</div>
+1 - 對於這個例子 - 雖然你應該得到+2,因爲我給了jani一個+1來快速抽籤,但是你包括了示例代碼;) – 2009-07-07 16:28:08