appendData: arg
This method appends contents of the arg
parameter to the current contents of
the data
attribute.
// Append to an existing string // Create a new Text object and reference the CharacterData interface CharacterData ndCD = (CharacterData)doc.createTextNode("The truth is "); // flip a coin ndCD.appendData((Math.random( ) < 0.5) ? "out there." : "in here."); System.out.println(ndCD.getData( ));