Entry
How do I get the href property for a linked image?
May 21st, 2001 05:13
Colin Fraser, Bobby DeRosa,
This is another one of those questions that people dont answer, mainly
because there seems to be no clear reason as to why the question was
asked in the first place, or maybe the question asked is not the
question that was intended to be asked. The answer is a no brainer.
JavaScript cannot be applied to someone else's pages, you have to own
and publish it. (While this is not strcitly true, to apply your
scripts to another person's page without their permission is cracking
that page, and, as such, is irresponsible.) If it is being applied to
your own page then why would you want to dynamically find a href
property? What you may want to do is to use a single image that
links to an array of URLs. The active link may depend upon a
pre-existing factor, an input of some type, like a password perhaps,
that selects a URL to send a user to a particular page.
This has probably been answered elsewhere in these pages.