+2  A: 

I prefer to use ", so after a full day of coding in JavaScript, I don't try to use ' on strings in C#

Allen
When I see single quotes in JavaScript it makes me cringe, unless they are using it for something regarding proper English grammar...I would rather just escape double quotes than use singles. I guess I spent too much time in C, C++ and C# using single quotes always means the char data type to me, not a string.
Jason Bunting
+2  A: 

I normally use the single quote simply because in ASPX it doesn't conflict with double quotes inside serverside scripts (<%= %>). Other than that it is a developer's choice.

Otávio Décio
another thing to point out is that if you want " inside of a string you can do it by using '' to enclose the string (and vice-versa)
Ben Scheirman
that wasn't very apparent.. the first one was a double quote, 2nd one single quotes :)
Ben Scheirman
+2  A: 

Most of the time I use html elements like that :

<input type="button" onclick="alert('test')" />

because of the attribute value has double quotes, I use single quote to represent javascript strings.

Canavar
Obtrusive JavaScript!!! Everyone run away, run away!
Jason Bunting
+1  A: 

I also prefer ", but tend to switch to ' if I have strings that contain HTML or XML code. But it's more a matter of taste since, if I remember correctly, ' is allowed in HTML and XML for attributes as well, so you could also do it the other way round.

OregonGhost
+1  A: 

My personal preference for Python (where, like JS, single and double quotes are equivalent) is for single quotes, just because that way there are "fewer pixels showing" (OK, a somewhat arbitrary criterion;-). But, it IS a matter for a "style guide" (either a personal one or one shared by a group of programmers working on the same codebase) rather than any objective rule.

Alex Martelli
+2  A: 

It's up to you. Double quotes are more common than single quotes in general, but I'll use single quotes if I have a double quote in my string. I don't force myself to only use double quotes.

var name = "John Doe";
alert('Hello there, "'+name+'", if that is your real name.');
John Kugelman
+2  A: 

See this previous question

Philippe Leybaert
A: 

There are two choices in Javascript solely for the developer to choose whichever is convenient at the time. There is no semantic or syntactic difference, unlike in other languages. So, use both to wild abandon!

Adam Luter