源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

jquery显示隐藏input对象

  • 时间:2021-03-07 22:23 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:jquery显示隐藏input对象
1 所属部门选择其他时 显示一个输入框进行填写 [img]http://files.jb51.net/file_images/article/201407/2014721110535389.jpg?2014621113710[/img] [img]http://files.jb51.net/file_images/article/201407/2014721113726015.jpg?2014621113738[/img]
#html
<select id='deptid' name='deptid' class="select" onchange='deptChange()'>
 <c:forEach var="item" items="${deptidList}" varStatus="status">
 <option value='${item.value}'> ${item.name} </option>
 </c:forEach>
</select> 
<!-- 类型为其他时 需要填写其它部门 -->
<input id='otherDept' name='otherDept' type="text" class="text" maxlength='50' style='display:none;'/>
//js
// 根据切换是否显示其他部门输入框
 function deptChange(){
 var deptid = $('#deptid').val();
 // alert('type:'+hytpye);
 if(deptid=='other'){
  $('#otherDept').show();
 }else{
  $('#otherDept').hide();
 }
 }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部