[thelist] Creating DOM element from a string

Mohsen Saboorian mohsens at gmail.com
Wed Aug 2 06:50:26 CDT 2006


Hi,
I have a string (e.g. "<input type='text' value='salam!' />"). Is
there any way to convert the String into a DOM element and access its
properties? Or I should use regex for handling such cases.

A simple solution could be inserting this string into an invisible
element's innerHTML, and then accessing the DOM object.

Thanks.



More information about the thelist mailing list