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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:58:51+00:00 2026-06-10T18:58:51+00:00

I have the following jQuery code: <script type=text/javascript> $(document).ready(function() { var color = [‘none’,

  • 0

I have the following jQuery code:

<script type="text/javascript">
    $(document).ready(function() {
        var color = ['none', 'green', 'yellow', 'red'];
        $('table').on('change','select', function() {
            $(this).parents('td').css('background', color[$(':selected', this).index()]);
        });​
    });
</script>

Which highlights all table cells on a row when an option in a select box is chosen. I have downloaded and implemented the jQuery cookie plugin. My Question is how can I implement functionality (additional code) so that the row of table cells will remain highlighted when the page is refreshed or when a user logs out.

  • 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-10T18:58:53+00:00Added an answer on June 10, 2026 at 6:58 pm

    All you need is to store selected color in the cookie and then read it back. You can use jquery cookie plugin. Sample usage here:

    $(document).ready(function() {
    
        if ($.cookie("yourname")) {
            // applying color from cookie
            var color = $.cookie("yourname");
            $('div').css('background', color);
            $('select').val(color);
        }
    
        $('div').on('change', 'select', function() {
            // applying selected color, storing it in the cookie
            var color = $(this).val();
            $.cookie("yourname", color);
            $('div').css('background', color);
        });
    
    });​
    

    DEMO

    PS: For the demo I use slightly modified script, since you haven’t provided your HTML markup.

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

Sidebar

Related Questions

I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
I have the following jquery code in my view <script type=text/javascript> $(document).ready(function () {
I have the following JQuery code: $(document).ready(function () { var $containerHeight = $(window).height(); if
I have the following code: <script type=text/javascript> var ops = { slideshow: { slices:
I have the following jquery code: $(document).ready(function() { $(body[class*=page-calendar-practices] #content-header h1#title).after(<div id='athletics_practice-schedule'><div id='inner-title'><a href='www.example.com'
<script type=text/javascript> $(document).ready(function() { $(#credit_pay).hide(); $(#downpayment_method).change(function() { if ($(#downpayment_method).val()=='credit_card') { $(#credit_pay).show(fast); } else {
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I Have Following codes: <html> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js></script> <script
i have the following jQuery code. $(function() { $('.clickme').click(function() { $('.totalthing').slideToggle('slow','easeInOutQuart', function() { //
I am having a link <a id=test href=text.php>test</a> I have the following jquery code

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.