<!Doctype html> <html> <body style="margin:0;padding:0"> <div style="margin-top:20px"> <p id="pid" style="margin-bottom:0;float:right;display:inline;">1001</b</p> <button id="btn1" style="display:inline;float:right;background-color:#0000FF;color:white" onclick="testJS()" >Buy Now</button> </div> <script> function testJS(){ var favoritemovie = document.getElementById('pid').value; sessionStorage.setItem("favoriteMovie", favoritemovie); window.location="buy.html"; } </script> </body> </html>
<!Doctype html> <html> <body style="margin:0;padding:0"> <div> <form action="#" method="post"> <div > <p id="tpid"></p> </div> </form> </div> <script> function myFunc(){ var favoritemovie = sessionStorage.getItem("favoriteMovie"); document.getElementById('tpid').innerHTML = favoritemovie; } window.onload=myFunc; </script> </body> </html>
var favoritemovie = document.getElementById('pid').innerHTML
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)