Yohanne Posted March 4, 2014 Share Posted March 4, 2014 Hi Coders, how to get/pass input text value into new page as output using javascript? Quote Link to comment Share on other sites More sharing options...
Q695 Posted March 4, 2014 Share Posted March 4, 2014 $_REQUEST is the stuff that does server requesting for data. Quote Link to comment Share on other sites More sharing options...
Yohanne Posted March 4, 2014 Author Share Posted March 4, 2014 yes, i already done it in php and now i want it in javascscrip? Quote Link to comment Share on other sites More sharing options...
Solution Yohanne Posted March 4, 2014 Author Solution Share Posted March 4, 2014 Something like this below but i want the value is show up in the new page. <body> <form> First Name: <input type="text" id="myText" name="fname" value="Mickey"><br> </form> <p>Click the button to return the value of the value attribute of the text field.</p> <p id="demo"></p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var x = document.getElementById("myText").value; document.getElementById("demo").innerHTML=x; } </script> </body> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.