Re: Changing nodeName/tagName
Péter Zsoldos <[email protected]>
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Joris Huizer wrote: > Chris Rule wrote: > >> Is it possible to change one nodeName to another with the DOM ? >> e.g. Changing an <input type='text'> to a <textarea>. > > You have to add a new element (a textarea) and insert it ? before ? the > input element; then you can remove the input element, effectively > replacing it > > Or you could just create a textarea element and then use the replaceChild method: inputNode.parentNode.replaceChild(createdTextarea, inputNode); Peter ------------------------ Yahoo! Groups Sponsor --------------------~--> 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/WpTY2A/izNLAA/yQLSAA/9rHolB/TM --------------------------------------------------------------------~-> Unsubscribe [email protected] List info http://www.quirksmode.org/dom/list.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wdf-dom/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/