0
点赞
收藏
分享

微信扫一扫

html提交参数到html


aa.html 提交参数到 view.html
aa.html代码如下:

<html> 

<head>

<title></title>

</head>

<body>

<form id="aa" action="./view.html" method="get">

<input type="text" id="result" name="result" value="12"/>

<input type="submit" id="submit" value="submit"/>

</form>

</body>

</html>




view.html代码如下:

<html> 

<head>

<title></title>

</head>

<script type="text/javascript">


function GetParam(){

var path=window.location.href;

var pos=path.indexOf("=");

var parm;

if(pos > 0){

parm=path.substring(pos+1,path.length);

}

document.getElementById('result').value=parm;

return parm;

}

</script>

<body οnlοad="GetParam()">


<input type="text" id="result" name="result" />


</body>

</html>

  • ​​test.rar​​ (569 Bytes)
  • 下载次数: 3
举报

相关推荐

0 条评论