944,155 Members | Top Members by Rank

Ad:
Nov 4th, 2009
0

change link border

Expand Post »
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
Similar Threads
Reputation Points: 15
Solved Threads: 2
Junior Poster
lifeworks is offline Offline
145 posts
since Nov 2007
Nov 4th, 2009
0
Re: change link border
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';
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 4th, 2009
0
Re: change link border
hi, i gave that a shot, but i am pretty sure the border reference is borderWidth....?!

still no joy
Reputation Points: 15
Solved Threads: 2
Junior Poster
lifeworks is offline Offline
145 posts
since Nov 2007
Nov 4th, 2009
0
Re: change link border
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.
Reputation Points: 120
Solved Threads: 61
Posting Pro
Troy III is offline Offline
513 posts
since Jun 2008
Nov 4th, 2009
0
Re: change link border
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
Reputation Points: 15
Solved Threads: 2
Junior Poster
lifeworks is offline Offline
145 posts
since Nov 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Vertically Expanding a DIV inside a Table TD
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: responseText format??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC