jQuery 11 动态生成标签

有个append()函数,相当于dom中的document.appendChild()函数,如下图:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="JScript/jquery-1.9.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var link = $("<a href='http://www.sina.com'>新浪连接</a>");
            $("body").append(link);
            link.text("搜狗");
           
        });
    </script>
</head>
<body>

</body>
</html>
原文地址:https://www.cnblogs.com/yagzh2000/p/3099023.html