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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:09:52+00:00 2026-06-03T01:09:52+00:00

On a button click I have following code inside my .Post(): if (Comment !=

  • 0

On a button click I have following code inside my .Post():

if (Comment != null && Grade > 0) {
    $("navigation").attr('a[data-id="' + QuestionID + '"]')
                   .css({ "background-color": "green" });
} else if (Comment == null && Grade == null) {
    $('a[data-id="' + QuestionID + '"]').css({ "background-color": "#D8D8D8" });

If I close my webapplication or just refresh it the color is gone. How can I make the color stay forever even if i close or refresh Do I have to addclass or something?

  • 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-03T01:09:56+00:00Added an answer on June 3, 2026 at 1:09 am

    Okay, so short answer: you can’t.

    Long answer: CSS files are stored on the remote server and served as requested (via the <link /> tag in the head of your HTML document). JavaScript is executed on your local machine, in the browser (unless you’re running node.js, I suppose). So your changes only exist as long as that particular scripting instance/page view is running. Reloading the page re-requests (depending on cache settings) the CSS file and reloads it.

    So, unless you want users to be able to freely modify your server files (a monumentally-bad idea), you really can’t do what it seems you want to…

    HTH.

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

Sidebar

Related Questions

I have the following code that responds to a button click, changes the view
I have the following code bound to the click event of a button: function
I have the following jQuery code to execute when I click a button $('#substat').click(function()
I have the following code: $(#tag-add-button).click(function () { var text = $(#tagadd).val(); var tagcounter=0;
i have this code in the button click to show selection image when the
I have this code in the end of link button click: Response.ContentType = application/zip;
inside a jquery method (on a click event of a button) i have the
I have the following code inside a class: this.buttons = { cancelButton:{buttonId: cancelButton, buttonText:Cancel,
I have the following View code: @using (Html.BeginForm(Login, Press, FormMethod.Post)) { <fieldset> <legend>User Registration</legend>
I have the following code to fetch the data from URL, store it in

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.