K!

by Karl Bunyan

Programming, PHP, JavaScript, .Net, motorbikes, pubs, poker, football, news, restaurants and anything else

Facebook
http://twitter.com/karlbunyan

Monday, April 11, 2005

Deleting page elements using removeChild in JavaScript

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.

Link to this post

Comments:
Post a Comment

Recent posts in the Programming category

Recent posts in the JavaScript category

Archive

Other links

Change the background image