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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:23:45+00:00 2026-06-16T19:23:45+00:00

In a page there is a div (#example_div) that toggles a class when click

  • 0

In a page there is a div (#example_div) that toggles a class when click on it using this code:

$(document).ready(function() {
    $("#parent_div").on('click', '.current_style', function () {
    $(this).toggleClass("new_style");
    });
}); 

Below the div #example_div there is a div called #load_content.

I want to find a solution to when a visitor click on the #example_div it toggles new style just as usually, but at the same time I want to load in some content to #load_content from another page. Then when untoggle #example_div, the loaded content in #load_content removes.

Is this possible?

Thanks.

  • 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-16T19:23:46+00:00Added an answer on June 16, 2026 at 7:23 pm
    $(document).ready(function() {
     $("#parent_div").on('click', '.current_style', function () {
     $(this).toggleClass("new_style");
     if( $(this).hasClass("new_style")) {
        // load content eg: $("#load_content").html("xyz");
     }
     else{
         $("#load_content").html("");
     }
     });
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey there, i have a div that expands when the page is loaded, now
On this page there is a list of footer links that have a little
I am working with a page that has multiple divs that toggle. This function
I currently have this code in the page/div when you load it without anything
my Page has many hover images, sometimes there are backgrounds from div-elements or src
I've got three columns inside of a div that is the full page width.
On the page there are links displayed with CSS as buttons: HTML: <a class=button
I'm loading a page in an iframe colorbox. On this page there's a form
at this page new customer , there is some clash between the two scripts.
I can center align 1 div in a page easy just by using 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.