Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

On click I want the hyperlink to get Bold

 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want the hyperlink to get Bold when user clicks on it. Then whenthe user clicks on other Hyperlink the previous bold hyperlink should come to its normal state.

I wrote this Js but hav no idea how to bring back all other hyperlink back to normal font weight.

 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dnt know what happened to the code I posted. here I am posting it again.

--> <li><a href="#" onClick="style.fontWeight='bold'">Theams</a></li>
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a bug with the code tags. You need to uncheck the disable html markup in order for it to work right.

You are not referencing anything, so that should be throwing an error.

you need a reference to the object [link] to do that, you need to use this.

this.style.fontWeight = "bold";

Eric
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Erc for the reply. I left it blank casually.
The problem is solved now.

[]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic