js获取前台页面中的值

 test1.html代码:
<html>
<head>
<title> TEST1 </title>
</head>
<body>
<script type="text/javascript">
function submit()
{
var input1= document.getElementByIdx("inputid");
window.open("test2.html?keyword=" + input1.value);//传入参数
}
</script>
<input type="text" id="inputid">
<input type="button" onclick="submit()" value="提交">
</body>
</html>
原文地址:https://www.cnblogs.com/QiuJL/p/4524275.html