Jump to content

after submit and get value from input text using javascript?


Yohanne

Recommended Posts

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.