The $ dollar sign

后端 未结 9 1802
执笔经年
执笔经年 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条回答
  •  -上瘾入骨i
    2020-11-29 04:25

    I like to prefix all my jQuery object names with $ so that I know it's actually a jQuery object, not a DOM reference.

    It's a good naming convention.

提交回复
热议问题