addClass() adds a specified class to an element.
$('a[href^="http://"]').addClass('externalLink');This code would take HTML like this:
<a href="http://www.oreilly.com/">
And change it to the following:
<a href="http://www.oreilly.com/" class="externalLink">
removeClass() is the opposite of addClass()
$('#alertBox') //id
$('.alertBox') //class
$('body') //tag
Post a Comment