Append link code

L

LsK_Lele

Hello !
I have a DIV, with a code inside it ...
I have to append dinamically some HTML code to this code, this code my
contain links ...
i tryed:

oDiv = document.getElementById("MyDiv")
oDiv.innerHTML = oDiv.innerHTML + "<a href=\"http://www.google.com\"
target=\"_blank\">http://www.google.com</a>"
Or
oDiv.innerHTML = oDiv.innerHTML + '<a href=\"http://www.google.com\"
target=\"_blank\">http://www.google.com</a>'
Or
oDiv.innerHTML = oDiv.innerHTML + "<a href=\x22http://www.google.com\"x22
target=\x22_blank\x22>http://www.google.com</a>"

But the window opened by this code does not points to www.google.com, but to
"http://localhost/www.google.com

Can someone help me ?
Thank you very much !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top