jQuery hasClass Snippet Example

Click to see if the first paragraph has a class of 'first':

Click to see if the first paragraph has a class of 'last':

Click to see if the last paragraph has a class of 'last':

first paragraph

paragraph

last paragraph

See the blog post.