Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

40 of 48 people (83%) answered Yes
Recently 9 of 10 people (90%) answered Yes


How to make link bold on click, while simultaneously resetting last clicked link to normal?

Apr 4th, 2008 21:07
ha mo, Iván Rivera, Jesper Bierbum,

Note that this solution doesn't work for NS4.x (it does for NS6.x, IE4
and IE5.x).
<script language="JavaScript">
var selectedLink;
function selectLink(lnk) {
  if (selectedLink)'normal';'bold';
<a href="#" onClick="selectLink(this)">Hello</a> <a href="#"
You can use as many links you like, as well as changing other CSS style
properties, simply by modifying selectLink() --change fontWeight for the
JavaScript name of any property you like to alter, and assign adequate
Hope this was useful.