topical media & game development
#javascript-code-08-ctrlKey.js / js
// Bind a click handler onto the entire document
document.onclick = function(e){
// Neutralize the Event object
e = e || window.event;
var t = e.target || e.srcElement;
// If the control key was held down while the click was made
if ( e.ctrlKey )
// Remove the clicked node
t.parentNode.removeChild( t );
};
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.