Don’t use innerHTML, but use Prototype’s Element.update method!

Note to self: When using prototype don’t use the innerHTML property.

Internet Explorer has got a (in my opinion) broken implementation for certain elements.
It is not possible to change the innerHTML content of the TR and SELECT elements.

Fortunally Prototype has fixed these problems in the Element.update method!

$(“tr_id”).update( “<td>Test</td>” );

1 Comment so far

  1. abi on March 7th, 2008

    brilliant. i’ve only recently begun using the JS prototype framework and was looking for a function to replace innerHTML. i must have overlooked this in the API documentation.

    thank you so much.

    xx

Leave a reply