Thomas Broyer: > How would you test that it is available? > > <script>if ("getElementsByClassName" in document) { ... }</script> > or > <script>if (document.getElementsByClassName) { ... }</script> > work, but how would you test that createElement and/or createElementNS > can take an additional argument? If document.getElementsByClassName is an actual Function, you could test that document.getElementsByClassName.length == 2. > createElementWithTextContent could work, but then you'd also want a > createAttributeWithValue. > > I doubt though there would be a huge advantage over doing: > var link_to_add = document.createElement("a"); > link_to_add.textContent = the_text.nodeValue; Agreed. -- Cameron McCormack, http://mcc.id.au/ xmpp:heycam@jabber.org ▪ ICQ 26955922 ▪ MSN cam@mcc.id.auReceived on Monday, 22 October 2007 07:36:06 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:40:04 GMT