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

  • Home
  • SEARCH
  • 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 8907819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:00:55+00:00 2026-06-15T03:00:55+00:00

Im using the addClass function with jQuery Mobile. I can see in the code

  • 0

Im using the addClass function with jQuery Mobile. I can see in the code that the class is added but its style that should be applied to it is ignored.

If I add the class to the html and refresh the page then the class is styled. So it seems to me that it might be something to with how JQM renders the page.

    $('.slider1').click(function(){
        $('.sliders').addClass('.slidersPosTwo');
    });
  • 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-06-15T03:00:56+00:00Added an answer on June 15, 2026 at 3:00 am

    Check-out the documentation for .addClass(): http://api.jquery.com/addClass/

    Notice how the examples omit the period (.) at the beginning of the class name. If you leave the period then it will be added as part of the class name, which should only be used as a selector.

    Your code will work if you make this change:

    ...
    $('.sliders').addClass('slidersPosTwo');//notice, no period before the class name
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery function which changes the class of element $(a).click(function(){ $(this).closest(ul).find(a).parent().removeClass(active); $(this).parent().addClass(active);
i am using jquery addClass and removeClass function here is code <script> $(document).ready(function() {
I would like to replicate jQuery's addClass function using plain javascript So far, I
I have dynamically added an element in page using jquery with following function. function
Hi i am using this code: jQuery(document).ready(function(){ var number = 1; /////////////////////////////////////////////////// /* The
Once I change element's class using jQuery, the click function does not work on
I've been buried in jQuery Mobile code and documentation for a while now, but
I am using jquery addClass code to show/hide elements when rolling over a div.
I am using a jQuery function to add/remove a class to the clicked element,
I was using the Add class method $(select[name=' + ABC+ i + ']).addClass('addBorder'); This

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.