日期:2014-05-16 浏览次数:20412 次
<script>
document.getElementById("cac_bus").onclick = function(e){
info ='<select id="add" >';
{foreach from=$region_list key=myId item=i}
info += '<option value="{$myId}">' + "{$i}" + '</option>';
{/foreach}
info += '</select>';
document.getElementById("cac_bus_info").innerHTML+=info;
}
</script>
document.onclick = function (e) {
e = e
------解决方案--------------------
window.event;
var o = e.target
------解决方案--------------------
e.srcElement;
if (o.id == 'cas_bus') {
info = '<select id="add" >';
{foreach from=$region_list key=myId item=i}
info += '<option value="{$myId}">' + "{$i}" + '</option>';
{/foreach}
info += '</select>';
document.getElementById("cac_bus_info").innerHTML += info;
}
else document.getElementById("cac_bus_info").innerHTML = '';
}