javascript local storage pass value one html web page to another

Поділитися
Вставка
  • Опубліковано 7 жов 2024
  • #htmllocalstorage #passvariableonepagetoanotherpage
    javascript local storage pass value one html web page to another
    In web development, it is often necessary to transfer data between different web pages. One efficient method to achieve this is by utilizing JavaScript's local storage feature. Local storage allows developers to store key-value pairs within the user's browser, enabling seamless data transfer between pages. In this article, we will explore how to pass values from one HTML web page to another using JavaScript local storage.
    Conclusion:
    JavaScript's local storage provides a convenient way to pass values between different HTML web pages. By storing key-value pairs in the local storage object, you can easily transfer data from one page to another. This method proves particularly useful when developing web applications that require state persistence across multiple pages. Utilize this approach effectively to enhance the user experience and create dynamic and interactive web applications.

КОМЕНТАРІ • 169

  • @adolfocarrillo248
    @adolfocarrillo248 3 роки тому +20

    Holy cow!!!, this is so exactly what I need!!!! Thank you for sharing your knowledge

  • @suvarnadhavale2882
    @suvarnadhavale2882 2 роки тому +1

    thank you sir.....it's really amazing ,i try lots for cods over the internet but no one is working...you can explain in very simple way ,it's really helpful for us ..thank you sir...

  • @Mohamed-eq3hj
    @Mohamed-eq3hj 2 роки тому +1

    Can't believe this,, i spent the entire day looking out for how to do this, i tried everything but nothing worked,
    And its THAT EASY !!!!!!
    thanks so much man

    • @codewithegai
      @codewithegai 2 роки тому

      Same here, exactly what I needed.

  • @franciscocatanach2257
    @franciscocatanach2257 Рік тому +1

    Ur voice is honestly so satisfying to listen to

  • @musicloop9582
    @musicloop9582 3 роки тому

    Please use some good free editors. You will get better syntax checking. Notepad+ is not enough. In your code, you have the opening tag inside the section and the closing tag is inside the . Also, I don't know why you have put inside the head. Please make the corrections.

  • @GalaxyCookies76
    @GalaxyCookies76 4 роки тому +9

    how to get more values from and display it.?

  • @padmanabhmalwade2750
    @padmanabhmalwade2750 2 роки тому

    Thank you soo much sir I've been tring trying since a week now it worked successfully!!!

  • @sadamali6691
    @sadamali6691 2 роки тому

    Waaw how lucky i am i was searching this kind of video about a week and i didn't find nothing but to night when i opened the UA-cam this video pop's up waaw pro you have got new subscriber thank you and this is what I excectly needed

  • @009-shrabantide9
    @009-shrabantide9 2 роки тому

    Thank you so much for saving my life by showing the code ... thank you

  • @shoney6289
    @shoney6289 3 роки тому

    Super Duper Excellent Video sir, GOD bless you with lot of happiness and Success. 😍😍😍😍😍😍🥰

  • @codewithmadrine7843
    @codewithmadrine7843 2 роки тому

    Holly Molly! Have been looking for this for almost 1 week, Thanks Geeks

  • @dchubad
    @dchubad 2 роки тому

    very strait forward, thumbs up

  • @jirayutphonyiam6220
    @jirayutphonyiam6220 4 роки тому +17

    I spend time for hour to find a bug.
    It is "onclick" ,NO "oneclick"
    I wanna cry

    • @heavygustav
      @heavygustav 4 роки тому +1

      hahahaahhaah....it happens bro stay vigilant

    • @timhoward5
      @timhoward5 4 роки тому

      I find "=" instead of "-"

    • @phanishwarlal4838
      @phanishwarlal4838 3 роки тому

      these bugs really suck!

    • @manojkumarsingh7463
      @manojkumarsingh7463 3 роки тому

      Haaaaaaaaaaaaaaaaa 🤣🤣🤣🤣 also it happens with me

    • @matyasmeszaros2227
      @matyasmeszaros2227 3 роки тому

      I had the same issue today with 'foreach' instead of 'forEach' lol

  • @bmfahim7321
    @bmfahim7321 2 роки тому

    thank you very much it was very helpful

  • @simpletextentertain8927
    @simpletextentertain8927 9 місяців тому

    can it work with or or text element else ?

  • @neuaction
    @neuaction Рік тому

    well done sir , you should share more such advanced videos, i have been looking for such videos almost for 3 months

    • @HarithaComputersTechnology
      @HarithaComputersTechnology  Рік тому

      Thanks Keep watching! and created a new javascript tutorials, passing multiple elements into a next page please visit sir !

  • @JustGame7
    @JustGame7 2 роки тому +1

    simple and neat, thank you, how can pass and get the same values,, like we use register and login form

  • @kazukamancha9664
    @kazukamancha9664 7 місяців тому

    thanks you sir, you help me in my homework

  • @olo-onlyliveonce
    @olo-onlyliveonce 2 роки тому

    So much search... Finally found you! Thank you so much I dropped a like and subed!!! Keep it up

  • @bhagyashreemore1045
    @bhagyashreemore1045 5 років тому +4

    thank you so much for this video i have been searching for this since month.. :) keep making such videos

  • @wicker1094
    @wicker1094 Рік тому

    Very nice video. Very short and correct.

  • @syskey1402
    @syskey1402 2 роки тому

    Thanks so much dude. RESPECT!!

  • @adityabanare9354
    @adityabanare9354 3 роки тому

    finally found the video
    Really helpful awesome

  • @vivoichsan1208
    @vivoichsan1208 8 місяців тому

    Sir, what if you use a dropdown list or radio button, what would the syntax be like if you wanted it to appear on the next page

    • @HarithaComputersTechnology
      @HarithaComputersTechnology  8 місяців тому

      i already made that tutorial .. please check this playlist you can find more than 150+ client side javascript tutorials
      ua-cam.com/play/PL5smYbP6KikPLQmfizfQSg-3cep7DzLUq.html

  • @saharshpanjala
    @saharshpanjala 3 роки тому +1

    it dint work for me it dint show up the variable in the span area

  • @iseliodelisi3671
    @iseliodelisi3671 4 роки тому

    Hi! Thanks your video i was able pass a variable to another page, thanks a lot!

  • @magorzataannaniczyporuk7953
    @magorzataannaniczyporuk7953 4 роки тому +1

    Thank you SO much sir! It helped me so much to advance with my project!

  • @leniangraeni9796
    @leniangraeni9796 4 роки тому +1

    Thank you so much sir. I'm very grateful to find this video^^

  • @genesislumapay9416
    @genesislumapay9416 3 роки тому +1

    does it only work on span tag? I tried passing data from input to another input and it doesnt work

  • @ainiexperiencias
    @ainiexperiencias 2 роки тому

    Thank, thank and thank!!!! That is exactly what I need

  • @sanityvortexx
    @sanityvortexx 4 роки тому +1

    it worked thanks man👍

  • @jatindhariwal8352
    @jatindhariwal8352 3 роки тому

    Thanks! It was really help full.

  • @zachfenton608
    @zachfenton608 3 роки тому

    nice and short video on how to get to another page! Is there a way I can have it pull data from another page. Like I have a page with the events and I want it to call the top 4 events to my homepage from the event page.

  • @rishbharora4246
    @rishbharora4246 4 роки тому

    Loved The Video! Keep up the spirit! Saved My Life!

  • @CaptionThisChallenge_
    @CaptionThisChallenge_ 4 роки тому +1

    Thanks bro....You saved my life

  • @ZeddyBoi786
    @ZeddyBoi786 2 роки тому

    Thank you sooo much i have been looking for this for ages ... but one thing... can you please explain how i can do this but just with buttons .. e.g. if i have a train station map i just need to press the train station buttons rather than typing in the train station names and then when i press departure station and arival station it displays from... to ... on a new page

  • @afguideshd913
    @afguideshd913 3 роки тому

    Where did you get a firstname from javascript?

  • @lucasrodriguez3511
    @lucasrodriguez3511 2 роки тому

    You are amazing bro!!

  • @harishhona
    @harishhona Рік тому

    Spent an hour with my lab teacher, and here he solved it within 6 and half minutes.

    • @HarithaComputersTechnology
      @HarithaComputersTechnology  Рік тому

      please check my new javascript tutorial playlist, you can find passing multiple selected elements

  • @arazmammadov9276
    @arazmammadov9276 4 роки тому

    Thank you so much!

  • @neutronstar77
    @neutronstar77 2 роки тому

    I got it, Thank you ver much!

  • @ktkkoko4331
    @ktkkoko4331 3 роки тому

    Thanks sir I really like it

  • @robertoriosmorales7528
    @robertoriosmorales7528 2 роки тому

    this was so useful, thanks

  • @sunilsrinivaas3424
    @sunilsrinivaas3424 2 роки тому

    Thank you so much sir

  • @adityaparulekar7159
    @adityaparulekar7159 3 роки тому +2

    How do you do the same, but for radio button instead of textbox?

  • @AymanLkhawa
    @AymanLkhawa 3 роки тому

    Thank you so much sir!!

  • @garifalo1
    @garifalo1 4 роки тому +1

    why the function return false?

  • @lechapolin
    @lechapolin 4 роки тому

    literally it saved my job. thanks!

  • @juniord_osbel
    @juniord_osbel 4 роки тому

    THANK YOU SO MUCH BRO!!

  • @Ic3m4te
    @Ic3m4te 5 років тому +1

    thanks sir, u helped me so much!!

  • @bruhda.a
    @bruhda.a 2 роки тому

    why did you do "return false" in function passValues ?

  • @bobbysidhu5894
    @bobbysidhu5894 2 роки тому

    Thanks

  • @souvikparui8233
    @souvikparui8233 4 роки тому

    Thanks you.....

  • @Stakin12
    @Stakin12 2 роки тому

    You're a javascript wizard

  • @raphaelrp4718
    @raphaelrp4718 2 роки тому

    Thanks a lot bro!

  • @handlebyme46
    @handlebyme46 Рік тому

    sir ap na ak field ka btay aghr multiple field ho input ki tb kysa kry gy

    • @HarithaComputersTechnology
      @HarithaComputersTechnology  Рік тому

      please check my other video in the javascript playlist, you can sending multiple values to the next page, thanks

  • @manaleeorpe3954
    @manaleeorpe3954 2 роки тому

    this helped a lot

  • @adnan8465
    @adnan8465 Рік тому

    thank you so much man

  • @xulum1299
    @xulum1299 4 роки тому

    thank you!

  • @paulolinks1
    @paulolinks1 Рік тому

    it is possible to define a value( "red car") in an image and on click the name "red car" print on another page?

  • @rushikeshrakshe8470
    @rushikeshrakshe8470 Рік тому

    Really ThanQ sir

  • @abiyuvan9261
    @abiyuvan9261 5 років тому +3

    Pls respond soon after submit only one data we are getting how to display multiple inputs on tabls

    • @pramodhvedula8314
      @pramodhvedula8314 3 роки тому

      Take multiple variables and pass by id or class name

    • @gloft6523
      @gloft6523 3 роки тому

      Pramodh Vedula how?

    • @akhils9663
      @akhils9663 3 роки тому

      @@pramodhvedula8314 sir how?

  • @handrew9894
    @handrew9894 3 роки тому +1

    why must i return false?

  • @MdMusa-dy3ci
    @MdMusa-dy3ci 4 роки тому

    Good explanation

  • @doublehead1973
    @doublehead1973 3 роки тому

    This is working wonderfully locally. Im trying to pass date selector data to another page where it creates a custom URL inside an based on the dates (hotel date selector). But as soon as I add the script to wordrpess, it wont pull the localstrorage. Is there any special consideration needed here? I added the scripts to the header and footer of the whole site... Its getting a url string but missing the dates. Works perfect locally with html... I tested the html on the server, works perfect. I can even point the HTML form to the wordpress result page and it works. Therefore it's on the form page (page 1) that somehow fails to follow the header script and store the variables on localstorage. Any ideas?

    • @doublehead1973
      @doublehead1973 3 роки тому

      Lol nevermind, I solved it. Missing a line of code (lol)

  • @jettarinpattanajirarutchag9929
    @jettarinpattanajirarutchag9929 2 роки тому

    if the data is radio button or checkbox. how can I pass? thank you for the answer.

  • @arcoding823
    @arcoding823 2 роки тому

    What to do if you use to pass it then gets alerted and the info will be in the other html

  • @mattb8426
    @mattb8426 3 роки тому

    You are a lifesaver!

  • @oyash516
    @oyash516 4 роки тому +1

    How to pass multiple variables ?

  • @gamersverse15
    @gamersverse15 2 роки тому

    thank you so much

  • @history7528
    @history7528 2 роки тому +1

    what if i want to generate the all page

  • @irinabacal9598
    @irinabacal9598 2 роки тому

    Hello. Nice video. Is it possible to pass multiple values from one page to another? I have an input where you can add words and they are displayed in the same page and I need to pass those values to the next page in order to display them there.

    • @hammerTime11
      @hammerTime11 2 роки тому

      You can make use of form tag and pass it on to the required field

  • @pradumkumar6933
    @pradumkumar6933 5 років тому

    Sir I will follow your all instructions and I will done but when I will try to pass multiple page values to one page then I can't. Please help, waiting for your reply.
    Thanku

    • @muhammadbilal6865
      @muhammadbilal6865 4 роки тому

      try it
      firstpage

      Sign Up Form
      Email:

      Password

      Mobile:

      Telephone:


      second pagehtml
      The name is :
      js
      function getData()
      {
      var email = document.getElementById("email").value;
      localStorage.setItem("txtValue", email);

      }
      document.getElementById("data").innerHTML=localStorage.getItem("txtValue");

  • @tiborifj.fazekas6251
    @tiborifj.fazekas6251 3 роки тому

    Awesome video!

  • @jirayutphonyiam6220
    @jirayutphonyiam6220 4 роки тому

    I love this!!

  • @bhanuvasantha2353
    @bhanuvasantha2353 3 роки тому

    Sir is it possible to keep a image instead of text

  • @danimichely2723
    @danimichely2723 2 роки тому

    Muito obrigada, senhor. Você me ajudou muito!

  • @flavioherrera9954
    @flavioherrera9954 4 роки тому

    bless you

  • @chelseafraher9392
    @chelseafraher9392 4 роки тому +1

    Gracias bro! A lo mejor no me entiendes, pero si jalo SIUUUUUUUUU

  • @aakashgupta7708
    @aakashgupta7708 4 роки тому

    Cannot set property 'innerHTML' of null
    facing this error. Please give solution

    • @muhammadbilal6865
      @muhammadbilal6865 4 роки тому

      try it
      firstpage

      Sign Up Form
      Email:

      Password

      Mobile:

      Telephone:


      second pagehtml
      The name is :
      js
      function getData()
      {
      var email = document.getElementById("email").value;
      localStorage.setItem("txtValue", email);

      }
      document.getElementById("data").innerHTML=localStorage.getItem("txtValue");

    • @bharathiyandra166
      @bharathiyandra166 8 місяців тому

      Hi @aakashgupta7708 is it resolved?

  • @dronareddy3613
    @dronareddy3613 5 років тому +4

    HOW CAN WE DO IT FOR MULTIPLE VALUES

    • @indrawanprast1772
      @indrawanprast1772 3 роки тому

      @Swapnil Prakash I tried and it still doesn't wor :(

  • @videloco84
    @videloco84 4 роки тому

    THX!!!!!!!!!!!!!!! I was lost and found your video

  • @aryanmathur
    @aryanmathur 3 роки тому

    THANK YOU SO SO SO SO MUCHHHHHH!!!!!!!!!!!!!

  • @gabrielamagrani1506
    @gabrielamagrani1506 3 роки тому +1

    Obrigada por esse video! (:

  • @maths4allbysrinivas
    @maths4allbysrinivas 3 роки тому

    Video quality is low,720p also not visible clearly.data consumes more.

  • @HarpreetKaur-lg1sf
    @HarpreetKaur-lg1sf 2 роки тому

    how can i use a textbox to capture that value?

  • @MARWATTECHS
    @MARWATTECHS 4 роки тому

    nice sir

  • @jenniferlacaste1383
    @jenniferlacaste1383 4 роки тому

    It doesn't work on my explorer but it works fine with firefox and chrome.

  • @mdiqbal7168
    @mdiqbal7168 2 роки тому

    How to decrease time for send data from page1.html file to page2.html file

  • @bharatns598
    @bharatns598 3 роки тому

    how to do this in reactjs

  • @akhils9663
    @akhils9663 3 роки тому

    Can you please give me a solution for transfering multiple variable?

  • @rashidmehmood7948
    @rashidmehmood7948 5 років тому

    thanku so much gentleman

  • @salahsallami5522
    @salahsallami5522 Рік тому

    Tank you

  • @tanayjoshi9578
    @tanayjoshi9578 Рік тому

    how do you do this with checkboxes

  • @front-enddeveloper-cf1jn
    @front-enddeveloper-cf1jn Рік тому

    ooooo goood thankyou bro oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

  • @chanakaramanayake8409
    @chanakaramanayake8409 3 роки тому

    thanks..

  • @yatinkher2679
    @yatinkher2679 2 роки тому

    Sir can you please make drop down form get value

  • @anujmore7547
    @anujmore7547 5 років тому

    Im not getting my next page? what should i do.

    • @hakdoghakdog4812
      @hakdoghakdog4812 4 роки тому

      Same :

    • @mihaiimihaii5530
      @mihaiimihaii5530 4 роки тому

      same dont work

    • @muhammadbilal6865
      @muhammadbilal6865 4 роки тому

      check it
      firstpage

      Sign Up Form
      Email:

      Password

      Mobile:

      Telephone:


      second pagehtml
      The name is :
      js
      function getData()
      {
      var email = document.getElementById("email").value;
      localStorage.setItem("txtValue", email);

      }
      document.getElementById("data").innerHTML=localStorage.getItem("txtValue");

  • @Kabir17
    @Kabir17 2 роки тому

    can i get the source code plz

  • @khamei8094
    @khamei8094 5 років тому

    It doesn't work in my test file 😞😞 waiting for your reply.

    • @muhammadbilal6865
      @muhammadbilal6865 4 роки тому

      tr it
      firstpage

      Sign Up Form
      Email:

      Password

      Mobile:

      Telephone:


      second pagehtml
      The name is :
      js
      function getData()
      {
      var email = document.getElementById("email").value;
      localStorage.setItem("txtValue", email);

      }
      document.getElementById("data").innerHTML=localStorage.getItem("txtValue");