innerhtml中调用JS自定义函数
JS代码_td3.innerHTML="<selectstyle='width:100%'name='dis_des_m"+trCount+"'id='dis_des_m...
JS 代码
_td3.innerHTML = "<select style='width:100%' name='dis_des_m" + trCount +"' id='dis_des_m" + trCount +"' class='select' style='width:100px;' onchange='set_amount('dis_des_m" + trCount +"','amount" + trCount +"')' >headload('dis_type_m"+trCount+"')</select>";
html 代码
<select style="width:100%" name="dis_type_m" id="dis_type_m" class="select" onChange= "set_type('dis_type_m','dis_des_m','amount')" >
<script language="javascript">headload('dis_type_m');</script> </select>
怎么实现上面的JS代码! 展开
_td3.innerHTML = "<select style='width:100%' name='dis_des_m" + trCount +"' id='dis_des_m" + trCount +"' class='select' style='width:100px;' onchange='set_amount('dis_des_m" + trCount +"','amount" + trCount +"')' >headload('dis_type_m"+trCount+"')</select>";
html 代码
<select style="width:100%" name="dis_type_m" id="dis_type_m" class="select" onChange= "set_type('dis_type_m','dis_des_m','amount')" >
<script language="javascript">headload('dis_type_m');</script> </select>
怎么实现上面的JS代码! 展开
1个回答
展开全部
<!DOCTYPE HTML>
<html>
<head>
<title>Page Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
onload=function(){
var trCount = 1;
var html = "<select style=\"width:100%\" name=\"dis_type_m" + trCount + "\" id=\"dis_type_m" + trCount + "\" class=\"select\" onchange=\"set_type('dis_type_m" + trCount + "','dis_des_m" + trCount + "','amount" + trCount + "')\" ><script language=\"text/javascript\">headload('dis_type_m" + trCount + "');<\/script><\/select>";
document.getElementById("_td3").innerHTML = html;
}
</script>
</head>
<body>
<table>
<tr>
<td id="_td3"></td>
</tr>
</table>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询