'and "can be used interchangeably in JavaScript / jQuery.
It is a little more reliable to use '.
Why? Because it is easier to move JavaScript code between tags scriptand embedded HTML elements, the general syntax of XHTML is to wrap the event code in ""(for example, onclick="alert('foo')"). Using single quotes prevents the need to exit (for example "alert(\"foo\")") and makes it easy to move code from a string to an external script page.
source
share