`
hsys
  • 浏览: 286920 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

jquery操作select

阅读更多

获取选中项的值
$jq("#mselect option:selected").val();


动态添加选项

for(var i=0;i<optionnum-1; i++){
	$jq("#mselect").append("<option value='"+(i+2)+"'>最多选"+(i+2)+"项</option>");
}


设置select选中项,即索引
$jq("#mselect").get(0).selectedIndex = maxselect;
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics