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 175239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:39:49+00:00 2026-05-11T13:39:49+00:00

This is a follow up to a previous question which seems to have confused

  • 0

This is a follow up to a previous question which seems to have confused people so I’ll purify it a bit. Here is some markup.

<div class='button width120 height30 iconLeft colorRed'></div> <div class='button width180 height20 iconPlus colorBlue'></div> <div class='button width200 height10 iconStar colorGreen'></div> <div class='button width110 height60 iconBack colorOrange'></div> 

The challenge is to fill in the code in the following.

$('.button').each(function(){      // Get the width from the class      // Get the height from the class      // Get the icon from the class      // Get the color from the class  }); 

Now, I know that you shouldn’t use classes this way so I’m not looking for alternative ways of doing it, this is an experiment and I’m interested to know if it’s possible to do it this 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. 2026-05-11T13:39:50+00:00Added an answer on May 11, 2026 at 1:39 pm

    Something like:

    $('.button').each(function(){     var classNames = $(this).attr('class').split(' ');     var width, height;     for(int i = 0; i < classNames.length; i++) {         var className = classNames[i];         if(className.indexOf('width') > -1) {             width = className.substring(5, className.length - 1);         } else if(className.indexOf('height') > -1) {             height = className.substring(6, className.length - 1);         } // etc. etc.     } }); 

    Or have I misunderstood what you were asking?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow up from my previous question I have this code basically
This is a bit of a follow-up from a previous question on improving rails
This is a follow-on from a previous question, in the implementation, I have two
This looks very similar to my previous question because it's some sort of follow
This is a follow up to a previous question . if I have multiple
A follow-up to my previous question. I have a button on my stage, which
This question follows on from a previous question which can be found here: Need
This is a follow-up questions on a previous one . Consider this code, which
This is a follow up question to a previous question I asked about calculating
This is a follow-up to my previous question . Suppose I am writing the

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.