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);

 

posted on 2014-12-17 15:39  oceanho  阅读(1216)  评论(0编辑  收藏  举报

导航