开发者

what javascript object am I looking for? click a button-it stays bold till the next one is clicked?

开发者 https://www.devze.com 2022-12-17 11:14 出处:网络
A very basic thing, I know.I have a collapsing div help box thing that is triggered when clicking links.Click the link, the help topic opens in th开发者_C百科e div.

A very basic thing, I know. I have a collapsing div help box thing that is triggered when clicking links. Click the link, the help topic opens in th开发者_C百科e div.

I want the text in the link to stay bold until I click another link. What function am i looking for? I'm using jquery. Thanks!


Assuming all your help links have a class of "help", define a class:

a.last { font-weight: bold; }

and then:

$("a.help").click(function() {
  $("a.last").removeClass("last");
  $(this).addClass("last");
});
0

精彩评论

暂无评论...
验证码 换一张
取 消