Friday, January 27, 2006

InnerHTML issues

Warning: geeky HTML stuff ahead.

RuneLancer, a fellow RPG hobbyist/developer pointed out a quirk about DOM scripting that I didn't know before and is a good thing to know: setting the innerHTML property of an element can remove it from the DOM. I've been tinkering with AJAX a bit, and was starting to really like the idea of being able to set the innerHTML of elements. But this problem could really cause inscrutable errors down the road if you're not careful.

My question is: is this behavior of the innerHTML property a quirk of a particular browser, or is it universal behavior?

No comments: