Search code examples
javascriptsyntaxsemantics

Double quotes vs single quotes in JavaScript


Possible Duplicate:
When to Use Double or Single Quotes in JavaScript
Are there differences between ' and "

I am wondering if there is a difference between using single quotes vs double quotes in JavaScript (JQuery selectors etc.).

Both seem to work just fine, so is there a difference?


Solution

  • The difference is that you don't need to escape single quotes in double quotes, or double quotes in single quotes. That is the only difference, if you do not count the fact that you must hold the Shift key to type ".