What does $($(this)) mean?

后端 未结 6 1415
借酒劲吻你
借酒劲吻你 2021-02-04 23:53

I saw some code around the web that uses the following statement

if ($($(this)).hasClass(\"footer_default\")) {
      $(\'#abc\')
        .appendTo($(this))
             


        
6条回答
  •  鱼传尺愫
    2021-02-05 00:05

    You can wrap $ as many times as you want, it won't change anything.

    If foo is a DOM element, $(foo) will return the corresponding jQuery object.

    If foo is a jQuery object, $(foo) will return the same object.

    That's why $($(this)) will return exactly the same as $(this).

提交回复
热议问题