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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:51:30+00:00 2026-05-30T09:51:30+00:00

Quick rundown – I’m adding a class of ‘checked’ to image elements when a

  • 0

Quick rundown – I’m adding a class of ‘checked’ to image elements when a user clicks on them.
Clicking my ‘Next’ button hides the ‘choose-photos’ div and shows the confirm div, injecting in the selected photos, like so:

$('.next').click(function () {
  $('.user-photos').attr('id', 'step-two');
  $('.choose-photos').hide();
  var selected = $('.checked').get();
  $('.confirm-batch').show().html(selected);
}
});

The .get() method is working quite well; however, if you click to back to step 1 and choose new photos, whichever photos you’ve selected are gone from the DOM.

$('.choose').click(function (){
 $('.user-photos').attr('id', 'step-one');
 $('.confirm-batch').hide().html('');
 $('.choose-photos').show();
}

});

Is there a way to get those ‘checked’ items back in the ‘choose’ div without reloading the page? Basically just resetting the process.

  • 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-30T09:51:31+00:00Added an answer on May 30, 2026 at 9:51 am

    jQuery overloads some of its methods with stupid behavior.

    One example is that it allows this…

    var selected = $('.checked').get();
    $('.confirm-batch').show().html(selected);
    

    It looks like you’re inserting an HTML string rendered from the selected elements, but you’re not, it’s reloacting them, as you normally would with DOM nodes.

    As a solution, you could either clone them, or better, just put them back where you found them instead of destroying them with .html('')

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

Sidebar

Related Questions

Here's a quick rundown on how my app is built: Elements are created dynamically.
Can anyone give me a quick rundown of the color syntax meanings in xcode?
Ok, so here's the quick rundown. I have a function to generate the page
quick question. In my user database I have 5 separate tables all containing different
I'm investigating encryption algorithms - can someone give me a quick rundown of the
Quick question: If I have a very large function/sub in a class that is
Quick preview of the problem: using .closest() , I'm able to stick a class
here's my first! quick rundown: SCENARIO i'm creating an app in which you can
Quick question. Is it okay to save a PHP class file as myClass.class and
Quick question. What do you think, I have a few sites that use a

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.