irst, add some style information into the <head> of your document, like this:
<style type="text/css">
a.test { font-weight: bold; }
</style>
Next, add the addClass call to your script:
$("a").addClass("test");
All your a elements will now be bold.
To remove the class, use removeClass
$("a").removeClass("test");
- (CSS allows multiple classes to be added to an element.)
Special Effects
In jQuery, a couple of handy effects are provided, to really make your web site stand out. To put this to the test, change the click that you added earlier to this:
$("a").click(function(event){
event.preventDefault();
$(this).hide("slow");
});
Now, if you click any link, it should make itself slowly disappear.















