JS控制select的默认选中项
2017-01-06 14:19
337 查看
<head runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<title>无标题页</title>
</head>
<script type="text/javascript">
function SELECT(index){
var select = document.getElementById("Select1");
select.selectedIndex=index;
}
$(document).ready(function () {
SELECT(1);
});
</script>
<body>
<form id="form1" runat="server">
<select id="Select1">
<option value="0">否</option>
<option value="1">是</option>
</select>
<div></div>
</form>
</body>
参考源码:
http://download.csdn.net/detail/liangzhuangdongtou/9730567
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<title>无标题页</title>
</head>
<script type="text/javascript">
function SELECT(index){
var select = document.getElementById("Select1");
select.selectedIndex=index;
}
$(document).ready(function () {
SELECT(1);
});
</script>
<body>
<form id="form1" runat="server">
<select id="Select1">
<option value="0">否</option>
<option value="1">是</option>
</select>
<div></div>
</form>
</body>
参考源码:
http://download.csdn.net/detail/liangzhuangdongtou/9730567
相关文章推荐
- JS 控制select选中项
- JS 控制select选中项
- 通过js根据接收的数据控制select标签的默认选择项
- js获取select默认选中的Option并不是当前选中值
- (vue.js)vue中怎么设置select默认选中
- html <select> 用JS控制默认选中项
- js控制select的options的几个选中和自动添加options值
- js 默认选中select 选项
- jquery 纯JS设置select下拉框,并默认选中第一个
- bootstrap-multiselect.js多选下拉框初始化时默认选中初始值
- js控制div显示隐藏与赋值,selelect默认选中,div显示竖向进度条
- js控制select选中显示不同表单内容
- js 清除select里的值,js控制select增删改,选中,清空, 判断控件是否存在 .(转)
- html js 清除select里的值,js控制select增删改,选中,清空, 判断控件是否存在
- js控制select的options的几个选中和自动添加options值
- js获取select默认选中的Option并不是当前选中值
- JS操作select相关方法:新增 修改 删除 选中 清空 判断存在
- 利用js给select添加option并选中该option
- js控制select 中option项的上下移动
- JS操作select相关方法:新增 修改 删除 选中 清空 判断存在 等