Asked by Wilson Edwards
at 2025-03-12 23:38:28
Point:500 Replies:2 POST_ID:829360USER_ID:12108
Topic:
javascript;html;css
I would like to create child node inside of body tag and enclosing all elements inside body tag
by javascript code;
For example:
Before:
<html>
<body>
<div></div>
<a></a>
<span></span>
</body>
</html>
After, if I would like to see this reuslt, creating new div tag enclose everything inside of body tag, new div tag 's id is new_child_node
After:
<html>
<body>
<div id='new_child_node'>
<div></div>
<a></a>
<span></span>
</div>
</html>
</body>
Please advise