jquery select 操作
<script type ="text/javascript">
$(document).ready(function(){
$("#Web1_hid").val($("#div").html());
// select add 1.
$("#sel").append("<option value='213123'>24324</option>");
//add 2.
var op = new Option();
op.text = "dsaf";
op.value = "asdf";
var sel= $("#sel")[0];
sel.options.add(op);
// 遍历
$("#sel option").each(function(){
alert($(this).val());
});
$("#sel").click(function(){
//获取值:
alert($("#sel option:selected").val());
// 取消选 中项:
$("
#sel option:selected").removeAttr("selected");
});
});
</script>
<div id ="div">123455</div>
<select id ="sel" name ="sel"></select>
<input type ="hidden" id ="hid" value ="" runat ="server"/>