I'm a newbie to web design, and have been piecing togther a site for a friend over the last few weeks basically by Googling everything I don't understand and trying to fit it all together. It's been an uplifting experince and have picked up some knowledge of MySQL, PHP, XML and AJAX along the way.
I nearly have all of the functionality I need to move forward but there is one thing really annoying me because I can't fix it, and I have had much look searching through usual resources..
Basically, I am dynamically displaying data on my HTML page by reading values from an XML file and writing to HTML using create.textnode().
Everything is working fine except that one of the fields I want to display is a web address and I want this text field to display as a hyperlink on the webpage. So if the XML entry was <webaddress>http://www.hotmail.com</webaddress> I need that to display as a hyperlink to Hotmail on the page. Currently it just gets inserted as a text string.
Example of the code I am using is:
Expand|Select|Wrap|Line Numbers
- var webaddress = xmldoc.getElementsByTagName('webaddress').item(1);
- txt3 = document.createTextNode(webaddress);
- document.getElementById('webaddressdiv').appendChild(txt3);
Any ideas as to how I make this dynamic text string into a dynamic hyperlink ?