Get other classes from an element with Jquery

Posted by Jigs on Stack Overflow See other posts from Stack Overflow or by Jigs
Published on 2010-05-22T11:58:13Z Indexed on 2010/05/22 12:00 UTC
Read the original article Hit count: 207

Filed under:

I am working on a small bit of script that will allow for easy and flexible creation of buttons.

My buttons are made of three parts, a left, a right and a streched middle piece. There are three different sizes and three different colours of each.

I have written the code that resizes the button to fit the text. Now I am looking to add the ability to easily set the colour and size.

I was thinking of using three classes something like <div class="button blue big"> My script already loops through the button classes using each. Now I need to find out what other classes are set and adjust the pictures and dimentions used to fit.

So how can I find out what other class selectors an element has?

Also I am fairly new to jquery/javascript so I am wondering if storing the design as class selectors is the best way.

© Stack Overflow or respective owner

Related posts about jQuery