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

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top