Hash sign in jQuery calls

javascript, jquery

Solution

`$('loc')` is an element selector, looking for `<loc>` elements.

`$('#loc')` is an `#id` selector, looking for `id="loc"` elements.

Think CSS when looking at almost all jQuery selectors, they're very close if not identical in most cases.

Problem

Being a pragmatic coder I tend to miss some obvious things and I wonder, What's the difference between ``` $('loc') $('#loc') ``` The more info the better about the ins and outs of #

Original source