The difference between single and double quotation marks and the use of jquery note

Source: Internet
Author: User

In JS, single quotation marks and double quotation marks are the same, usually use a single quotation mark, only when the nested time will be used in both quotation marks, interested friends can understand the following:


The syntax that can be executed: $ ("ul Li a"). Filter (": Contains (' Canon '),: Contains (' Panasonic '),: Contains (' Casio ')"). CSS ("Color", "red");

Error syntax: $ ("ul Li a"). Filter (": Contains (" Canon "),: Contains (" Panasonic "),: Contains (" Casio ")"). CSS ("Color", "red");


According to the document displayed in JS single quotation marks and double quotation marks are the same, but in use is to meet the question, so Baidu gave me the solution, said is usually used when the use of single quotation marks, only when the nested will be used at the same time two kinds of quotation marks. That is, the outside is a single quotation mark when the inside is to use double quotation marks, the outside is double quotation marks when the inside to use single quotation marks, in short, can not use double or single quotation marks;

In case of forgetting,

Referenced from: http://www.jb51.net/article/40163.htm

The difference between single and double quotation marks and the use of jquery note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.