I have something simple like this:
$(selector).append("somestuff");
But since I\'m going to reuse the selector I cache it with:
I've seen it done both ways. All you are doing is creating a variable with the name '$selector', so they are functionally equivalent. The nice thing about it is that it does make them easy to pick out as jQuery objects.