aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes On click I want the hyperlink to get Bold Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "On click I want the hyperlink to get Bold" Watch "On click I want the hyperlink to get Bold" New topic
Author

On click I want the hyperlink to get Bold

Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

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.



My Blog SCJP 5 SCWCD 5
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Aug 18, 2008
Posts: 598

Thanks Erc for the reply. I left it blank casually.
The problem is solved now.

[]
 
Consider Paul's rocket mass heater.
 
subject: On click I want the hyperlink to get Bold