目录

html()

功能

获取或设置指定元素的HTML内容。

语法

noder.html(node,html)

参数

范例

Example: 为div设置一些内容。

<!DOCTYPE html>
<html>

<head>
    <style>
.red { color:red; }
    </style>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.3/require.min.js"></script>
    <script>
    require.config({
        baseUrl: "./",
        packages: [{
            name: "skylark",
            location: "../../../src/skylark"
        }, ]
    });
    </script>
</head>

<body>
  <span>Hello</span>
  <div></div>
    <script>
    require(["skylark/query", "skylark/finder", "skylark/noder"], function(query, finder, noder) {
      noder.html(finder.find("div"),"<span class='red'>Hello <b>Again</b></span>");
    });
    </script>
</body>

</html>