请问html怎么将select中的值附给script,并输出给另一个平台。
<html>
<head>
<meta charset="UTF-8"/>
<title>螺栓工具</title>
<style>
body{
background-color: #f0f0f0;
width: 230px;
height: 200px;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block;">
螺栓规格:M
<select id="lsgg"style = "width: 41px;height: 22px">
<option value="16">16</option>
<option value="20">20</option>
<option value="24">24</option>
</select>
</div>
<div style="display:inline-block;">
<div >
X <input id="jc" type="text" value="45"style = "width: 41px;">
</div>
</div><br/> <p style="line-height:45px">
<div>通过厚度:<input id="tghd" type="text" value="25"style = "width: 120px;"></div><br/>
<form action="#" name=form1 onclick="check()">
螺帽类型:
<input type="radio" name="lmlx" value="1" checked/>单
<input type="radio" name="lmlx" value = "2" />双
</form><br/>
<script>
function form1(lmlx){
//var lx;
lx=document.getElementsByName(lmlx)
if(lx!=null){
var i;
for(i=0;i<lx.length;i++){
if(xl[i].checked){
return lx[i].value;
}
}
// }就是这个值传输给另一个script里面总是出错
</script>
<form>
<input id="lx" type = "hidden">
</form>
<div>材质:
<select id="cz">
<option value="red">red</option>
<option value="yellow">yellow</option>
<option value="purple">purple</option>
</select>
</div>
</div>
<div style="float: right; margin-right: 10px;">
<input type="button" value="确定" onclick="confirm()">
<input type="button" value="取消" onclick="cancel()">
</div>
</body>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
function confirm(){
var lsgg = $("#lsgg").val();
var jc = $("#jc").val();
var tghd = $("#tghd").val();
var lx = $("#lx").val();
var cz = $("#cz option:selected").text()
var data_arr = [lsgg, jc, lx, 0, tghd, cz]
<html>
<head>
<meta charset="UTF-8"/>
<title>螺栓工具</title>
<style>
body{
background-color: #f0f0f0;
width: 230px;
height: 200px;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block;">
螺栓规格:M
<select id="lsgg"style = "width: 41px;height: 22px">
<option value="16">16</option>
<option value="20">20</option>
<option value="24">24</option>
</select>
</div>
<div style="display:inline-block;">
<div >
X <input id="jc" type="text" value="45"style = "width: 41px;">
</div>
</div><br/> <p style="line-height:45px">
<div>通过厚度:<input id="tghd" type="text" value="25"style = "width: 120px;"></div><br/>
<form action="#" name=form1 onclick="check()">
螺帽类型:
<input type="radio" name="lmlx" value="1" checked/>单
<input type="radio" name="lmlx" value = "2" />双
</form><br/>
<script>
function form1(lmlx){
//var lx;
lx=document.getElementsByName(lmlx)
if(lx!=null){
var i;
for(i=0;i<lx.length;i++){
if(xl[i].checked){
return lx[i].value;
}
}
// }就是这个值传输给另一个script里面总是出错
</script>
<form>
<input id="lx" type = "hidden">
</form>
<div>材质:
<select id="cz">
<option value="red">red</option>
<option value="yellow">yellow</option>
<option value="purple">purple</option>
</select>
</div>
</div>
<div style="float: right; margin-right: 10px;">
<input type="button" value="确定" onclick="confirm()">
<input type="button" value="取消" onclick="cancel()">
</div>
</body>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
function confirm(){
var lsgg = $("#lsgg").val();
var jc = $("#jc").val();
var tghd = $("#tghd").val();
var lx = $("#lx").val();
var cz = $("#cz option:selected").text()
var data_arr = [lsgg, jc, lx, 0, tghd, cz]