首页 > Web开发 > 详细

jQuery Select 自动选择默认值

时间:2014-12-17 16:03:26      阅读:315      评论:0      收藏:0      [点我收藏+]

//
//
// 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 自动选择默认值

原文:http://www.cnblogs.com/guizhouhehai/p/4169551.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!