Home  >  Q&A  >  body text

$("ul").append($li1)对这句还是没怎么明白,求解释?

checkcheck2834 days ago1219

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 22:49:36

    $("ul").append($li1) I still don’t understand this sentence, please explain? -PHP Chinese website Q&A-$("ul").append($li1) I still don't understand this sentence. Can you please explain? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-17 17:12:51

        <script>
            $(function(){
                var $li = $("<li>php中文网</li>"); 
                $("ul").append($li1); 
            })
        </script>

    首先我们创建了一个节点,赋值给$li   

    我们使用append这个方法,在选中的ul里面去添加$li   运行后,打开调试工具,在ul标签中会增加一个 "<li>php中文网</li>"

    reply
    1
  • Cancelreply