...

View Full Version : Replacing the HTML inside a <div>



Koopa
03-11-2006, 06:52 PM
I would greatly appreiciate any help i could get.

I'm working with an Invision Free forum, so i'm pretty limited by what i can do.

Here is part of the source that i can't edit. (with the URLs changed)

<div id="logostrip">
<a href="linkURL" title="Board Home"><img src="imageURL" alt="" border="0"></a>
</div>

How would i go about (if it's even possible) changing the link via a Javascript code?

Thank you to anyone who helps!

Kravvitz
03-11-2006, 08:14 PM
if(document.getElementById && document.getElementsByTagName) {
var box = document.getElementById('logostrip');
box.getElementsByTagName('a')[0].href='http://www.google.com/';
}

JavaScript tutorial - W3C DOM introduction (http://www.howtocreate.co.uk/tutorials/javascript/domintroduction)
http://www.quirksmode.org/dom/
http://www.quirksmode.org/js/dom.html
http://www.brainjar.com/
http://developer.apple.com/internet/webcontent/dom2i.html
http://www.mozilla.org/docs/dom/domref/dom_doc_ref.html
http://www.mozilla.org/docs/dom/domref/
http://www.w3schools.com/htmldom/dom_obj_document.asp
http://www.sitepoint.com/article/rough-guide-dom
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference
http://digital-web.com/articles/forms_usability_and_the_w3c_dom/
http://www.w3.org/DOM/

Koopa
03-12-2006, 10:58 PM
Thankyou! Much appreciated!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum