动态移除元素属性
<select name="hour" style="width: 5%" id="hour" onclick="hourShow()" onchange="show();"> <option>{$scheduleItem['hour']}</option> </select>
<script> function hourShow(){ var hours = ''; for(var i=0;i<=23;i++){ hours+="<option value='"+i+"'>"+i+"</option>"; } $("#hour").html(hours); $("#hour").removeAttr('onclick'); } </script>