Ca-Phun Ung

Freelance web developer and Internet consultant at Yelotofu.
Categories
- Accessibility (6)
- Browser Testing (5)
- CSS (11)
- Django (3)
- Events (5)
- Hong Kong (3)
- JavaScript (18)
- Labs (2)
- Optimisation (2)
- PHP (8)
- Ramblings (12)
- Reviews (6)
- Ruby on Rails (4)
- Tools (5)
- Web Standards (10)
- WiFi (3)
jQuery: outerHTML
The outerHTML property (IE only) could sometimes be very handy, especially if you’re trying to replace an element entirely. Brandon Aaron has very kindly given us a outerHTML plugin that does half the job as it doesn’t support replacements. The following code snippet fills in the blanks: jQuery.fn.outerHTML = function(s) { return (s) ? this.before(s).remove() [...]