jquery single and double quotes distinguish and use note

Source: Internet
Author: User
In JS, single and double quotes are the same, usually use when using single quotes, only when you encounter nesting will be used in two quotes, interested friends can understand the syntax can be executed: $ ("ul Li a"). Filter (": Contains (' Canon ')": Contains (' Panasonic '),: Contains (' Casio '). CSS ("Color", "red");

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

According to the data shown in JS single quotes and double quotes are the same, but in the use is to encounter problems, so Baidu gave me the answer, that is usually used when the use of single quotes, only when the nesting will be used in two quotes. That is, when the outside is a single quotation mark, the inside is to use double quotes, the outside is a double quotation mark in the time to use single quotes, in short, can not use double quotes or single quotes;

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.