change link border

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Nov 2007
Posts: 81
Reputation: lifeworks is an unknown quantity at this point 
Solved Threads: 2
lifeworks lifeworks is offline Offline
Junior Poster in Training

change link border

 
0
  #1
23 Days Ago
Hi

I have a link, which triggers a script, but when the link is clicked, i want it to get a border around it... currently tried using

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. onclick="this.style.borderWidth = 1px"

but no luck,

lworks
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 523
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 61
network18 network18 is offline Offline
Posting Pro
 
0
  #2
23 Days Ago
maybe you not getting the current reference in this.
Did you tried like below-
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. document.getElementById('elem_id').style.border-width = '1px';
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 81
Reputation: lifeworks is an unknown quantity at this point 
Solved Threads: 2
lifeworks lifeworks is offline Offline
Junior Poster in Training
 
0
  #3
23 Days Ago
hi, i gave that a shot, but i am pretty sure the border reference is borderWidth....?!

still no joy
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
0
  #4
23 Days Ago
of course, thats because your border doesn't have a color for you to see it, you sould set the bordercolor also. Or assign a previously defined class instead. it keeps things cleaner.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 81
Reputation: lifeworks is an unknown quantity at this point 
Solved Threads: 2
lifeworks lifeworks is offline Offline
Junior Poster in Training
 
0
  #5
23 Days Ago
awesomeness... i did already have a border declared in my stylesheet, but setting the class name with this.className sorted it out. thanks dude, lifesaver!

lworks
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC