how to pass the data from one page to another in javascript 1

how to pass the data from one page to another in javascript

var favoritemovie = "Shrek";
sessionStorage.setItem("favoriteMovie", favoritemovie);

Here is what the above code is Doing:
1. We create a variable called favoritemovie and set it equal to the string “Shrek”.
2. We then use the setItem() method to create a key called “favoriteMovie” and set its value to the string “Shrek”.

Similar Posts