What is the difference between $(“*”, $(“#container1”)) and $(“#container2”).find(“*”)?

后端 未结 2 1712
花落未央
花落未央 2021-01-25 10:50

What is the difference between $(\"*\", $(\"#container1\")) and $(\"#container2\").find(\"*\")?. I usually use AA, but not well in that case can be mo

2条回答
  •  一个人的身影
    2021-01-25 11:39

    I believe the context selector must implicitly call find() itself.

    Best to just use find() for simplicity.

    EDIT: source code from 1.3.2:

    // HANDLE: $(expr, [context])
    // (which is just equivalent to: $(content).find(expr)
    

提交回复
热议问题