javascript - get the id of one post from one page to another page in html -
i trying id of 1 object 1 page page.
i have 2 pages
- index.html
- intro.html
index.html
<input type="text" name="fname" value="" id="idnew"> <a href="intro.html"><input type="button" value="post" id="butonid"></a> <script> $("#butonid").click(function(){ $('#idnew').val("4") } </script> now want send input value of id idnew intro.html page.
please me
val("4") sets value element, right before loading intro.html , discarded along previous page. send value, forget javascript altogether , use form:
<form action="intro.html" method="get"> <input type="text" name="idnew" value=""> <input type="submit" value="submit"> </form> then access value, instance in php use $_get['idnew']
Comments
Post a Comment