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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:06:46+00:00 2026-06-14T22:06:46+00:00

expanding on my last question how can I store the last selected value from

  • 0

expanding on my last question how can I store the last selected value from my dropdown but each time the user changes his pick I keep (the previous selected value) and (the current selected value). Do i need to use an array and use push/pop or is there another way to do this?

$(document).on('change', 'select[name=options]', function() {

var prev_selected =  $(this).val();
$(this).data('prev_selected',prev_selected);
alert(prev_selected );


//alert(current_selected );

});

HTML

<table id="Final">
<thead>
<th>Tie</th> <th>Pie</th><th>Lie</th>
</thead>

<tr>
<td><select class="Member" name="options">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">ball</option>
    <option value="4">4</option></td>
    <td>
    <select class="Member" name="options" price="200">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option></td>

    <td>
    <select class="Member" name="options" price="200">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">shoe</option>
    <option value="4">4</option></td>

    </tr>

    </table>
  • 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-14T22:06:47+00:00Added an answer on June 14, 2026 at 10:06 pm

    You basically want to capture that previous value on focus, which occurs before the change.

    Here’s a similar post answering your question: Getting value of select (dropdown) before change

    (function () {
        var previous;
    
        $("select").focus(function () {
            // Store the current value on focus, before it changes
            previous = this.value;
        }).change(function() {
            // Do something with the previous value after the change
            alert(previous);
        });
    })();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I apply clipview to a vertical expanding Group? Time to time I'm appending
Expanding on recent_posts_on_self below, I want to add an all_recent_posts_on_self method but I'm not
Expanding on Jon Skeet's answer to This Previous Question . Skeet doesn't address the
My app is expanding, but the reqs dictate that there should be only one
I am loading data for child nodes from server side on expanding the row.
I'm trying to create a table with each cell having a fixed width but
Originally I wanted to ask this question , but then I found it was
Last January I asked a question about sending string information between computers. Using the
I have a question regarding User Controls created with Visual Studio 2010. Specifically, I
Since expanding a large gzip file takes quite long time (sometimes over half 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.