javascript - What is the effect of deleting page nodes in js? Isn't it the same effect to directly delete the specific code?
迷茫
迷茫 2017-06-26 10:52:18
0
1
747

Xiaobai asked.

Also why in jquery, append inserts the node, and you can directly

later

$("p").append("<p>hello</p>")

Why can $("") be omitted? Doesn't $("") be required to create new jq nodes?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
曾经蜡笔没有小新

So do you think it is easier to operate by deleting nodes directly or deleting code directly?
To delete all elements with class del on the page, you can’t go directly to the code. It wouldn't be bad if there were 100 such elements.
append() This method is equivalent to html+=, so the content that follows can be directly inserted into the page. The browser automatically parses and renders automatically and can be inserted.
The role of the $ symbol in jQuery

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template