当前位置: 代码迷 >> JavaScript >> jQuery动态创造DOM的代码,有点不懂,求大神解释
  详细解决方案

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

热度:144   发布时间:2013-02-04 10:50:22.0
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() {
                                        $(this).blur()
                                        $(".fullBox,.alertBox").remove()
  相关解决方案