Howdy! Thanks for coming and enjoy your stay! Take a look at the sitemap and don't forget to chirp!

Posts Tagged ‘dom’

Javascript: Element Suicide

March 16th, 2009

A short tip on js suicide. Suicide? Well.. I mean have an element remove itself. I came across this a while ago: a ‘read more’ link which should set the display property of an element to ‘block’ and remove itself completely from the DOM. Plain javascript, no frameworks. Here’s what I came to: this.parentNode.removeChild(this); It [...]