Difference between $(document.body) and $('body')

前端 未结 6 1577
傲寒
傲寒 2020-12-13 11:48

I am a jQuery beginner and while going through some code examples I found:

$(document.body) and $(\'body\')

Is there any difference

6条回答
  •  甜味超标
    2020-12-13 12:26

    There should be no difference at all maybe the first is a little more performant but i think it's trivial ( you shouldn't worry about this, really ).

    With both you wrap the tag in a jQuery object

提交回复
热议问题