jquery显示隐藏input对象
更新时间:2014年07月21日 11:39:35 投稿:hebedich
这篇文章主要介绍了jquery显示隐藏input对象,需要的朋友可以参考下
1 所属部门选择其他时 显示一个输入框进行填写


#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();
}
}
相关文章
使用CDN和AJAX加速WordPress中jQuery的加载
这篇文章主要介绍了使用CDN和AJAX加速WordPress中jQuery的加载的方法,注意一下WordPress中以及CDN的Google连接在内地的网络问题,需要的朋友可以参考下2015-12-12
capacityFixed 基于jquery的类似于新浪微博新消息提示的定位框
公司项目需求中有一个类似于新浪微博新消息提示的定位框的效果,需要的朋友可以参考下。2011-05-05
Jquery+CSS 创建流动导航菜单 Fluid Navigation
有时,一个网站的导航菜单文字不能提供足够的信息,来表达当前菜单按钮的内容,一般的解决办法是使用提示信息ToolTip,那么本文介绍的流动导航菜单Fluid Navigation也可以解决此问题,同时也为网站设计的添加了一些时尚而又动感元素。2010-02-02


最新评论