/*
1.jQuery jquery.[ ].js javascript 。 jquery.color.js
2. jQuery.fn jQuery 。
3. ,this jquery , , chick() , this dom
4. this.each
5. , , , , ,
。
6. jquery , 。 ,
7. $ jquery , jquery , 。 ,
, $ jquery 。
*/
//; ,
;(function($){// $
//$.fn.extend
$.fn.extend({
"color":function(value){//color
//jQuery css this.css(" "," ");
return this.css("color",value);
}
});
})(jQuery);// jquery
function red(){
alert($("#div").color()+" ");
alert($("#div").color("red")+" Jquery ");
$("#div").color("red");
}
HTMLでプラグインを使用する例:
<div id="div" onclick="red()">dddddddddddddddd</div>
</body>