jQuery插件初级练习1答案

html:

<script>

$(".btn").click(function(){
$.color($("#box"),"blue").html("变化")
})

</script>

        jQuery:    //单独建立js文件存放,然后在html头部导入

   jQuery.color=function(obj,value){
$("#box").css("background",value)
return obj
}

         

posted on 2018-05-24 21:18  革命军总部  阅读(69)  评论(0)    收藏  举报