$(document) vs. $(“document”)

后端 未结 4 1114
北恋
北恋 2020-12-06 11:44

Is there any difference between: $(document) and $(\"document\")?

EDIT: also when into the .ready() e.g. $(\"document\")

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 12:05

    document is a pre-made global variable that is the representation of the current HTML document, short for window.document.

    $("document"), as @BoltClock pointed out, would be using that string as a selector for a element.

提交回复
热议问题