What does $($(this)) mean?

后端 未结 6 1409
借酒劲吻你
借酒劲吻你 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-05 00:15

    There is no meainig of doing that.

    The following code return the same:

    console.log($($(this)).hasClass("footer_default"))
    console.log($(this).hasClass("footer_default"))
    

    a boolean value depenging on if the selected element has or not the class footer_default:

    .hasClass( className )Returns: Boolean

    Demo: http://jsfiddle.net/IrvinDominin/aSzFn/

提交回复
热议问题