Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-11-2006, 06:52 PM   PM User | #1
Koopa
New to the CF scene

 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Koopa is an unknown quantity at this point
Replacing the HTML inside a <div>

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)
Code:
<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!
Koopa is offline   Reply With Quote
Old 03-11-2006, 08:14 PM   PM User | #2
Kravvitz
Senior Coder

 
Join Date: Feb 2006
Location: USA
Posts: 1,013
Thanks: 0
Thanked 0 Times in 0 Posts
Kravvitz is an unknown quantity at this point
Code:
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.quirksmode.org/dom/
http://www.quirksmode.org/js/dom.html
http://www.brainjar.com/
http://developer.apple.com/internet/...ent/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..._DOM_Reference
http://digital-web.com/articles/form...d_the_w3c_dom/
http://www.w3.org/DOM/
__________________
Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
Java != JavaScript && JScript != JavaScript
Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.
Kravvitz is offline   Reply With Quote
Old 03-12-2006, 10:58 PM   PM User | #3
Koopa
New to the CF scene

 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Koopa is an unknown quantity at this point
Thankyou! Much appreciated!
Koopa is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:20 AM.


Advertisement
Log in to turn off these ads.