Timmie Posted October 25, 2005 Share Posted October 25, 2005 In my HTML code I use images with areas to create links. The areas call JavaScript which changes the source of the image. When the source changes I want to be able to disable and enable certain areas. I've tried doing this by setting "nohref" but the script doesn't recognize the code. Can this be done and if so, what is the proper syntax? Link to comment Share on other sites More sharing options...
Jonas Posted October 25, 2005 Share Posted October 25, 2005 Give your tag an id, and write something like this:<a id="your_id" href="#" onclick="document.getElementById('your_id').href='new href' "></a>or<img id="your_id" src="img_src" onclick="document.getElementById('your_id').src='new src' " /> Link to comment Share on other sites More sharing options...
actionsketch Posted October 25, 2005 Share Posted October 25, 2005 Also, in that particular situation, it might be be easier to say:<a href="#" onclick="this.href='new href' "></a>or<img src="img_src" onclick="this.src='new src' " /> Link to comment Share on other sites More sharing options...
Timmie Posted October 25, 2005 Author Share Posted October 25, 2005 Can I assume from this that nohref is not supported by current browsers? Link to comment Share on other sites More sharing options...
Jonas Posted October 26, 2005 Share Posted October 26, 2005 Can't recall even having heard of nohref... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now