frequently ask ? : Computers : Programming : Languages : JavaScript : Language Core : E4X (ECMAScript for XML) : XML objects

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 1 people (100%) answered Yes
Recently 1 of 1 people (100%) answered Yes

Entry

How do I use the method appendChild?
How do I use the method appendChild?

Apr 8th, 2005 03:34
Martin Honnen,


You can use appendChild to append a new child at the end of this XML
object's properties, the changed XML object is then returned:
  var xmlObject = <gods><god>Kibo</god></gods>;
  alert(xmlObject.appendChild(<god>Xibo</god>));
  /* shows
  '<gods>
     <god>Kibo</god>
     <god>Xibo</god>
   </gods>'
  */