for example here in documentation http://api.jquery.com/attribute-contains-selector/ it says
$('input[name*="man"]')
I would write instead
$("input[name*='man']")
is there any reason to use single or double quotation marks on inside or outside ?? is it just a matter of taste?
If you use single quote marks, you should use double speech marks for a quote within a quote. If you use double quote signs, you should use single quotation signs for a quote within a quote. Examples: "When I say 'immediately,' I mean sometime before August," said the manager.
General Usage Rules In America, Canada, Australia and New Zealand, the general rule is that double quotes are used to denote direct speech. Single quotes are used to enclose a quote within a quote, a quote within a headline, or a title within a quote.
Single quotation marks are also known as 'quote marks', 'quotes', 'speech marks' or 'inverted commas'. Use them to: show direct speech and the quoted work of other writers. enclose the title of certain works.
Use double quotation marks (“”) around a direct quote. A direct quote is a word- for-word report of what someone else said or wrote. You use the exact words and punctuation of the original.
It's just a matter of taste, and sometimes convenience.
You are using quotation marks both in Javascript and in a jQuery selector, and in both cases you can use either apostrophes (') or quotation marks (") to delimit strings.
In some cases it's more convenient to use one type over the other, for exampe when you have Javascript code in an HTML attribute, as apostropes doesn't need to be escaped:
<div onclick="alert('Hello world!');">
compared to:
<div onclick='alert("Hello world!")'>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With