0

If there is an difference, if I use " or ' in javascript or html?

Till now I was coding in php and java only and now I don't know, if I can use ' only or do I have to use ".

I know a bit stupid question, but it makes me confuse, since I am used to ' syntex instead of ".

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Dariss
  • 1,258
  • 1
  • 12
  • 27
  • 1
    Please do some basic research. Like Google, maybe. –  Sep 01 '13 at 15:47
  • 1
    It's not a stupid question it has been asked before, but you could find the answer on google I think. Anyway, check this: http://stackoverflow.com/questions/242813/when-to-use-double-or-single-quotes-in-javascript – Sergio Sep 01 '13 at 15:48

1 Answers1

1

In JavaScript and in HTML, choosing single vs. double quotes is style preference–there is no functional difference like there is in PHP. Commas in JavaScript serve the same purpose as in PHP plus they can be used in expressions.

ryanve
  • 50,076
  • 30
  • 102
  • 137
  • 1
    I think the OP is using the word _comma_ to mean _single quote_. I've seen other posters refer to these as _top comma_. – Barmar Sep 01 '13 at 16:03
  • @Barmar Good call. [Top or inverted comma](http://en.wikipedia.org/wiki/Quotation_mark) – ryanve Sep 01 '13 at 16:08