jQuery Select 自动选择默认值
//
//
// the Select target Auto Select value extension plugin
//
// -------------------------------------------------------------------------- //
(function ($) {
$.extend($.fn, {
//
AutoSelect: function (options) {
// default options of plugin
var defaults = {
atr: "val",
filter: "select"
}
// deep copy $.extend(isDeepCopy,default_src,ext1,ext2,ext3,ext4,......);
var new_options = $.extend(true, defaults, options);
var $this = $(this);
$this.each(function () {
var $t = $(this);
// alert($t.prop("tagName".toLocaleUpperCase()));
if (new_options.filter.toLocaleUpperCase() != $t.prop("tagName")) {
$t.val($t.attr(defaults.atr));
}
})
}
});
})(jQuery);
jQuery Select 自动选择默认值的更多相关文章
- js jquery select 操作 获取值,选中选项,增加,修改,删除
select示例: <select id="sel"> <option value="1">one</option> < ...
- jquery select取值,赋值操作
select">jquery select取值,赋值操作 一.获取Select 获取select 选中的 text : $("#ddlRegType").find( ...
- Jquery常用radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关设置
获取一组radio被选中项的值:var item = $('input[name=items][checked]').val(); 获取select被选中项的文本:var item = $(" ...
- jquery获得select option的值 和对select option的操作
jQuery获取Select元素,并选择的Text和Value: 1. $("#select_id").change(function(){//code...}); //为Se ...
- jquery获取select选中的值
http://blog.csdn.net/renzhenhuai/article/details/19569593 误区: 一直以为jquery获取select中option被选中的文本值,是这样写的 ...
- jquery获得select option的值和对select option的操作
<body> <select name="month" id="selMonth" onchange="set()"> ...
- jQuery如何获得select选中的值?input单选radio选中的值
jQuery取得select选中的值 本来以为jQuery("#select1").val();是取得选中的值, 那么jQuery("#select1").te ...
- jquery 取得select选中的值
1.取得选中的值 jQuery("#select").val();是取得选中的值 2.取得的文本 jQuery("#select option:selected&quo ...
- JQuery/JS select标签动态设置选中值、设置禁止选择 button按钮禁止点击 select获取选中值
//**1.设置选中值:(根据索引确定选中值)**// var osel=document.getElementById("selID"); //得到select的ID var o ...
随机推荐
- Thinkphp源码分析系列(五)–系统钩子实现
Thinkphp的插件机制主要依靠的是Hook.class.php这个类,官方文档中在行为扩展也主要依靠这个类来实现.下面我们来具体看看tp是怎么利用这个类来实现行为扩展的. 首先,行为扩展是什么?有 ...
- python 赋值、表达式
赋值的特性 赋值语句建立对象引用 变量名在首次赋值时会被创建 变量名在引用前必须先赋值 赋值语句的形式 序列赋值 >>> A, B = 1, 2 >>> print ...
- angularjs 遇到的问题汇总
angular2 学习资源集锦:https://github.com/timjacobi/angular2-education 在学习angular开发项目过程遇到的问题:
- Linux:Vmware安装linux虚拟机,桥接方式配置静态IP后重启网卡,提示:Error,some other host already uses address 10.252.252.21...
问题: Vmware安装linux虚拟机,桥接方式配置静态IP后重启网卡,提示:Error,some other host already uses address 10.252.252.21... ...
- 第三次作业:caculator
第三次作业 作业链接 ********* 遇到的问题: Scan类: 队列的使用方法不了解,上网查询并自己练习了一下才初步了解,才运用到作业 . 判断数字用的 if (input[i] >= ' ...
- nginx缓存引发的问题
请求为f.chinasoft.com/file f.chinasoft.com 域名指向slb(3.3.3.3) 业务方式: ios-->slb(3.3.3.3)-->ecs集群(每一台e ...
- java类型占用字节数&类型转换
1.整型类型 存储需求 bit数 取值范围 备注int 4字节 4*8 short ...
- C# 获取系统时间及时间格式
--DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 取当前年月日时分秒 currentTime=System. ...
- Chrome浏览器官方下载地址
Chrome浏览器离线安装包官方下载地址,和在线安装一样能自动更新. 正式版 http://www.google.com/chrome/eula.html?hl=zh-CN&standalon ...
- 写了cookie阻止通过输入地址直接访问下一个html,但是直接输入地址访问时,会闪一下下一个页面,怎么回事啊????、
描述:做了两个页面login.html index.html 在index的body加了onload事件,调用一个js,js中有cookie的判断,防止没有登录就打开index.html,如果没 ...