欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery顯示隱藏input對(duì)象

 更新時(shí)間:2014年07月21日 11:39:35   投稿:hebedich  
這篇文章主要介紹了jquery顯示隱藏input對(duì)象,需要的朋友可以參考下

1 所屬部門(mén)選擇其他時(shí) 顯示一個(gè)輸入框進(jìn)行填寫(xiě)

#html
<select id='deptid' name='deptid' class="select" onchange='deptChange()'>
 <c:forEach var="item" items="${deptidList}" varStatus="status">
 <option value='${item.value}'>&nbsp;${item.name}&nbsp;</option>
 </c:forEach>
</select> 
<!-- 類型為其他時(shí) 需要填寫(xiě)其它部門(mén) -->
<input id='otherDept' name='otherDept' type="text" class="text" maxlength='50' style='display:none;'/>
//js
// 根據(jù)切換是否顯示其他部門(mén)輸入框
 function deptChange(){
 var deptid = $('#deptid').val();
 // alert('type:'+hytpye);
 if(deptid=='other'){
  $('#otherDept').show();
 }else{
  $('#otherDept').hide();
 }
 }

相關(guān)文章

最新評(píng)論