Tech Journal Back to Tech Journal

DHTML adding of child elements in MSIE 6 and in Mozilla 1.0.7 (Gecko 20050915)

Editing innerHTML of TR's isn't a good idea in mozilla, though it works perfectly under MSIE. But if you want to do changing or setting of attributes, use outerHTML instead (which doesn't work at all under Gecko)

Under gecko (Mozilla) use the createElement("TR") and createElement("TD") in conjunction with appendChild() - to build a complete TR. After it is complete, attach it to the TABLE element (optionally removing the old TRs)

Last updated on 2005-10-18 15:00:00 -0700, by Shalom Craimer

Back to Tech Journal