9

Which method do you guys prefer?
$("#test") or $('#test')

Comments
  • 5
    Single quotes err day boi
  • 0
    Wouldn't say it's a different method...just different syntax
  • 1
    Second one but I have used both. (Sometimes in the same project...oops 😳)
  • 2
    I'd say single quotes just in case a string you want pass in contains double quotes
  • 0
    Single quotes, reminds me I’m scripting and not native programming so I don’t accidentally type “int num;”
  • 2
    document.getElementById('test')

    ...just to be contrary :)
  • 1
    It depends on the code, but i use mostly the first
  • 2
    Neither, I don't use bloatQuery
  • 1
    Prefer using getElementById..

    But if i use jQuery(`#test`) evertime for jquery template string
Add Comment