search

Home  >  Q&A  >  body text

javascript - What is the effect of deleting page nodes in js? Isn't it the same effect to directly delete the specific code?

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?

迷茫迷茫2830 days ago797

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-06-26 10:54:18

    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

    reply
    0
  • Cancelreply