Home >Web Front-end >JS Tutorial >The difference between jquery single quotes and double quotes and their usage notes_jquery
Executable syntax: $("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, single quotes and double quotes are the same in js, but I encountered problems when using them, so Baidu gave me the answer , it is said that when using it in daily life, try to use single quotation marks. Only when nesting is encountered, two quotation marks will be used at the same time. That is, when there are single quotes outside, double quotes must be used inside, and when there are double quotes outside, single quotes must be used inside. In short, double quotes or single quotes cannot be used at the same time;