The $ dollar sign

后端 未结 9 1807
执笔经年
执笔经年 2020-11-29 04:16

I have something simple like this:

$(selector).append("somestuff");

But since I\'m going to reuse the selector I cache it with:

9条回答
  •  情深已故
    2020-11-29 04:44

    Yeah.

    jQuery always returns a jQuery object. It's what allows chaining.

    You've already defined the variable so you get a jQuery object back so $ is unnecessary

提交回复
热议问题