Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 805241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:03:12+00:00 2026-05-15T00:03:12+00:00

I am working on a small bit of script that will allow for easy

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:03:13+00:00Added an answer on May 15, 2026 at 12:03 am

    To get all classes you can do this:

    $('div.button').attr('class').replace(/\s+/,' ').split(' ');
    

    will return

    ['button','blue','big']
    

    Update:

    Or to check if an element has a specific class:

    $('div.button').hasClass('blue');
    // or
    $('div.button').hasClass('big');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working in a small company and weeks away from deploying a web-app that
I'm working on a small UML editor project, in Java, that I started a
I'm working on a small C++ project which involves a launcher application that does
I've been quite used to working on small projects which I coded with 1,000
I'm working on a small templating engine, and I'm using DOMDocument to parse the
I am working on a small intranet site for a small company, where user
I am working on a small application in VB.NET. The program needs administrator privilege
I'm working with a small FAT16 filesystem, and I want to generate CRC values
I'm working on a small app where I can generate a list of barcodes.
I'm working on a small bugtracking system which shows a list of bugs. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.