I was using this solution to hide divs on middle mousclick, but now I need to include it inside a plain debug script where no jQuery is available ( and never will ).
How can I write that event and bind with plain javascript?
I was searching google and SO, but only working scripts I got, where all jQuery based.
Final code:
<script type="text/javascript">
function hideOnMiddle(event) {
if ('which' in event) {
if( event.which == 2 ) {
document.getElementById('test').style.display = 'none';
}
}
}
</script>
<div id="test" onmousedown="hideOnMiddle(event);">Hide me with middle mouse button</div>