Deleting page elements using removeChild in JavaScript
11 April 2005, by Karl Bunyan
Here's a handy(?) script to delete pieces of any page you're on when you click on them...
Here’s a handy(?) script to delete pieces of any page you’re on when you click on them:
javascript: document.onclick = new
Function('e', 'document.all ? src=event.srcElement : src=e.target; src.parentNode.removeChild(src); return false'); void(0);
Go to any page on the web, paste it into the address bar of your browser and then start clicking around. It works okay in IE6 and Firefox - I haven’t tried it in anything else but it
should be okay in IE5 (PC), and might work in Safari.
It uses JavaScript to access the DOM and then tells every element you click on
to delete itself from its parent. Generally, a bit suicidal.
Try it out by clicking on this link and then clicking around on the page.
April 11, 2005 at 10:51 am
Filed in: Front-end, Programming
No comments