Navigation Menu
Alphabetical Listing
Site Contents

Site FAQ
About JSS
JavaScript Forum
JavaScript Tutorial
Friends of JSS

Link to Us
JavaScript Help
Contribute a script
Technology Jobs

Become a Partner

Internet.commerce

Be a Commerce Partner


Developer Channel

FlashKit.com
JavaScriptSource
Developer Jobs
ScriptSearch
WebDeveloper.com
Webreference
HTMLGoodies
HTML5 Dev Center
Developer.com
jGuru.com
PHPBuilder

Great Sites

DocJavaScript.com
dhtml.com
The Freebie Directory
TheFreeSite.com

Browse Doc JS's Tips!


Hiermenus Central


Promotions

Free Announcements


Social Bookmark

General

This script will cause a link to appear in bold type after it is clicked. Good for frame navigation, as well as anchors on a page or in a div. Easy to use.


this is link 1
this is link 2
this is link 3
this is link 4
this is link 5
this is link 6

Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: boldLinks.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


User Comments

Add a comment, suggestion, or correction
[For questions about usage, consult the Notes tab above or visit the JavaScript forum. Do not include more than two (2) lines of code in your comments. If you have suggestions or corrections, you can submit them to us.]

    
   
       
[optional]
 
[optional]

   

Comments feed Comment Feed RSS 2.0

10. From: Ashley
Highlighting First Link
11/12/2008 11:26:47

Is there a way to highlight the first link without using css?
For example, can I do:

<a href="#" style="font-weight: 900;" onclick="turnBackBold (this);">link 1</a>

Thanks!

11. From: Lee (Admin)
11/18/2008 11:53:17

Sure, you can do it that way. But it is CSS, it's just inline.

8. From: Marco
Highlight first link
10/14/2008 16:54:52

Great script. How could I ensure the first link shows up bold when the page is first loaded? Thanks!

9. From: Lee (Admin)
11/06/2008 11:49:57

Place this in your CSS file:

.boldLink [
font-weight: 900;
}

Then add the class to the link:

<a href="#" class="boldLink" onclick="turnBackBold (this);">this is link 1</a><br>

6. From: cheryl Brick
bold links
01/31/2008 14:38:56

thank you. I am trying to create this website graphicchimp
and saw your tutorial.

Is it possible using this BOLD LINKS technique to have a graphic appear in place of the bold text.

7. From: Lee (Admin)
06/26/2008 10:44:50

Yes, but you would need to re-write the script. If you need additional help, you'll need to post your question over on the forums.

4. From: Tiago de Azevedo
PHP ID? load?
10/09/2007 20:19:47

Hi, this script is great but i need to onclick in the link of page load a id of a database and when i use your script, when I click the the fontWeight desapear. I think im using php and database and the page reload and lost the bold. Can I do that without desapearing the bold?
TKS a LOT!

5. From: Lee (Admin)
11/07/2007 15:28:14

You will need to submit your question to the JavaScript Forum for further help.

1. From: MUFFASO
nice
08/27/2007 17:42:10

Ur code simplified my life... thnx

2. From: compassman
Question
08/20/2007 19:20:57

How would you change the source code so that when you clicked on a link, the text would go bold AND you would do something, like load a new page?

next comments...

Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.