在指定节点的内容外层包装一个节点。
noder.wrapperInner(node,wrapperNode)
Example: 点击按钮给 div 元素外层加上 p 元素。
<!DOCTYPE html> <html> <head> <style> div { border: 2px solid blue; } p { background: yellow; margin: 4px; } </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> <button>wrapperInner</button> <div>Hello</div> <script> require(["skylark/query", "skylark/noder"], function($, noder) { $("button").on("click", function() { noder.wrapperInner($("div")[0], noder.createElement("p")); }); }); </script> </body> </html>