PDA

View Full Version : DOM and html code?


doodguy
06-02-2009, 09:03 PM
I'm working with the google maps API and have this code:

document.createTextNode("<? echo $row[businessname]; ?> <BR>HI"));

Output: Businessname

However I want to add on and have this:

document.createTextNode("<? echo $row[businessname] . "HI"; ?> <BR>HI"));

Output: Businessname
Hi

But this only shows; Businessname<BR>Hi

How do I fix this to accep the html <BR> tag among other tags like hyperlink etc?

_Aerospace_Eng_
06-02-2009, 09:10 PM
createTextNode does just that, create text. You need to use createElement to actually create the br element and then use appendChild on the element you want the br to appear in.

doodguy
06-02-2009, 09:29 PM
createTextNode does just that, create text. You need to use createElement to actually create the br element and then use appendChild on the element you want the br to appear in.

I'm sorry I'm total noob to this I'm researching this but can you point me in right direction where to learn this plssssss

adios
06-03-2009, 04:40 AM
http://www.quirksmode.org/dom/intro.html