By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,608 Members | 1,940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,608 IT Pros & Developers. It's quick & easy.

Referencing an Image's Map's Link's Details

P: n/a
Hi All,

I have scoured my JavaScript book, but can't find the answer, so I
hope that you can help...

I have a banner on my webpage, called (creatively) "banner".
This banner uses a map called "bannerMap".
The map has an area called "homeLink".
The area's href is "home.htm".

How do I reference this href?

I have tried:
document.bannerMap.homeLink.href - FAILED
document.banner.bannerMap.homeLink.href - FAILED
document.homeLink.href - FAILED
document.banner.homeLink.href - FAILED

Has anyone tried this before? Is it possible? What is the answer?!

Thanks
Luke
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
is****@hotmail.com (Lucanus) writes:
I have a banner on my webpage, called (creatively) "banner".
This banner uses a map called "bannerMap".
The map has an area called "homeLink".
I assume you mean name="homeLink" or id="homeLink". It is recommended
to use id. Then, if all else fails, you can do
document.getElementById("homeLink")
The area's href is "home.htm". How do I reference this href?
Try:
document.links['homeLink'].href
document.bannerMap.homeLink.href - FAILED
document.banner.bannerMap.homeLink.href - FAILED
document.homeLink.href - FAILED
document.banner.homeLink.href - FAILED


You shouldn't assume that the name of an element can be used as a
property name of document (or window, or anything except for the
appropriate collections).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.