• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable an image anchor

 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there a JS function to dynamically disable an image anchor
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by 'image anchor'? Code please.
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to dynamically disable the hyperlink for an image and the onclick should be disabled
[ September 18, 2005: Message edited by: Mary Cole ]
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an image with somecode in the onClick event and I have another select box and have some code in the onChange event. On selecting a different value in the selectbox, I want the above image anchor/hand cursor to be disabled so that I cannot click it during the time the page refreshes.

Can anybody throw some light on this.
Thx
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then remove the onclick event

document.getElementById("asdf").onclick = NULL

Eric
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I added this code, but the hand cursor still remains and confuses the user.Is there a way to remove the hand cursor?
 
Jayesh Lalwani
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have 2 div tags with the same data. One div tag can have the link, and the other without the link. Only one div tag should be shown at a time
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can change the cursor using the CSS cursor rule.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic