日期:2014-05-16  浏览次数:20345 次

jQuery动态创建DOM的代码,有点不懂,求大神解释

        <script>
        $(function(){
                $("input").click(function(){
                        $.alertBox("This is msg");

                })
        })
        jQuery.extend({
                alertBox:function(msg){
                        var fullBox = $("<div>",{"class":"fullBox"}).appendTo("body")
                        if ($.browser.msie && ($.browser.version == "6.0")) {
                                fullBox.append("<iframe></iframe>")
                        }                
                        var alertBox = $("<div>",{"class":"alertBox"}).appendTo("body")
                        var p = $("<p>",{
                                text : msg
                        }).appendTo(alertBox)
                        var enterButton = $("<a>",{
                                "href" : "javascript:void(0)" ,
                                "title" : "确认" ,
                                text : "确认" ,
                                click : function() {