js onchange事件怎么在外部实现,我写的老是不行
document.getElementById("pro_select").onChange=select();document.getElementById("city...
document.getElementById("pro_select").onChange = select();
document.getElementById("city_select").onChange = select();
省份 <select id="pro_select" name = "province" ></select>
城市 <select id="city_select" name = "city" ></select> 展开
document.getElementById("city_select").onChange = select();
省份 <select id="pro_select" name = "province" ></select>
城市 <select id="city_select" name = "city" ></select> 展开
1个回答
展开全部
你的事件名写错了,是onchange都是小写的,还有你可以这样写,代码记得写在这个html标记的后面或者写在window.onload=function(){};里面
document.getElementById("pro_select").onchange = function()
{
select();
}
document.getElementById("city_select").onchange =function()
{
select();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询