Get other classes from an element with Jquery
- by Jigs
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.