mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 17:15:06 +00:00
22 lines
476 B
HTML
22 lines
476 B
HTML
<style>
|
|
#rect {
|
|
width: 300px;
|
|
height: 300px;
|
|
border: 5px solid black;
|
|
}
|
|
</style>
|
|
<div id=rect></div>
|
|
<pre id=out></pre>
|
|
<script>
|
|
function handle(e) {
|
|
var out = document.getElementById('out');
|
|
out.innerHTML = e.type + ' @ ' + e.offsetX + ',' + e.y + '\n' + out.innerHTML;
|
|
}
|
|
|
|
var rect = document.getElementById('rect');
|
|
rect.onmousedown = handle;
|
|
rect.onmousemove = handle;
|
|
rect.onmouseup = handle;
|
|
rect.onclick = handle;
|
|
rect.ondblclick = handle;
|
|
</script>
|