jquery插件小结

用法一

    <p>hello world!</p>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
    jQuery.fn.goShop = function() {
        return this.each(function() {
            jQuery('body').append('<div>Purchase: ' + this.innerHTML + '</div>');
        });
    }

    jQuery('p').goShop();

    </script>

 

用法二

 

posted @ 2014-09-03 18:12  欧欧欧子  阅读(102)  评论(0)    收藏  举报