无标题文档
$(function(){
//获取第一个option的值
var firstval=$('#selectID option:first').val();
alert(firstval);
//获取最后一个option的值
var lastval =$('#selectID option:last').val();
alert(lastval);...
分类:
Web程序 时间:
2014-07-22 23:02:15
阅读次数:
367
html页面代码如下:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">
* { margin:0; padding:0; }
div.centent {
flo...
分类:
Web程序 时间:
2014-06-08 16:53:59
阅读次数:
424
jquery对select下拉框的操作总结。。。1、通过索引值去设置select中的option的value和textvarindex=1;varval="该改为的值";$("#selectIdoption:eq("+index+")").attr("selected",true);$("#selectIdoption:selected").val(val);$("#selectIdoption:selected").text(val);
分类:
Web程序 时间:
2014-05-15 19:00:51
阅读次数:
314
每次操作select都要查资料,干脆总结一下。为select设置placeholder为Select添加事件,当选择其中一项时触发$("#select_id").change(function(){
//code...});jQuery获取Select选择的Text和Value:var che...
分类:
Web程序 时间:
2014-05-08 05:48:25
阅读次数:
509