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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:08:12+00:00 2026-06-04T21:08:12+00:00

Hi I am a beginner web developer and am trying to build the interface

  • 0

Hi I am a beginner web developer and am trying to build the interface of a simple e-commerce site as a personal project.The site has multiple pages with checkboxes.

When someone checks an element

  • it retrives the price of the element and
  • stores it in a variable.

But when I go to the next page and click on new checkboxes products the variable automaticly resets to its original state.

How can I save the value of that variable in Javascript?I am using the jQuery library.

EDIT:This is the code I’ve writen using sessionStorage but it still dosen’t work when I move to next page the value is reseted.

How can I wright this code so that i dosen’t reset on each page change.All pages on my website use the same script.

$(document).ready(function(){
         var total = 0;



            $('input.check').click(function(){
                if($(this).attr('checked')){
                    var check = parseInt($(this).parent().children('span').text().substr(1 , 3));
                    total+=check;
                    sessionStorage.var_name=0 + total;
                    alert(sessionStorage.var_name);

                }else{
                    var uncheck = parseInt($(this).parent().children('span').text().substr(1 , 3));
                    total-=uncheck;


                }
            })
  • 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-04T21:08:13+00:00Added an answer on June 4, 2026 at 9:08 pm

    The syntax for sessionStorage is simple, and it retains it’s data until the browser window is closed. It acts exactly like any other javascript object. You can use dot-notation or square bracket notation (required for keys with spaces) to access stored values.

    Storing values using sessionStorage

    sessionStorage['value key'] = 'value to store';
    

    Using stored values

    alert(sessionStorage['value key']);  // Alerts "value to store".
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a beginner web developer and i have a site JammuLinks.com , it
im a total beginner in web programming. Im trying to create a simple website
I'm a beginner with Zend. I have a little web site in which I
PHP beginner working from a tutorial. I'm trying to do a simple upload from
I'm still a complete beginner in the field of web development and I'm trying
I am beginner java web developer, now my question is after i developed my
I am beginner in web development, I am developing a site that allows user
I'm absolute beginner in web technologies. I know that my question is very simple,
I am a web application developer, just a beginner. I am designing a small
NOTE: I'm a beginner web developer, somewhat familiar with PHP. I've been curious about

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.