Home  >  Article  >  Web Front-end  >  jquery 单引号和双引号的区别及使用注意_jquery

jquery 单引号和双引号的区别及使用注意_jquery

WBOY
WBOYOriginal
2016-05-16 17:27:301284browse

可以执行的语法:$("ul li a").filter(":contains('佳能'),:contains('松下'),:contains('卡西欧')").css("color","red");

错误的语法:$("ul li a").filter(":contains("佳能"),:contains("松下"),:contains("卡西欧")").css("color","red");

据资料显示在js中单引号和双引号都是一样的,但是在使用是去碰到了问题,于是乎百度给我答案,说是平时使用的时候尽量用单引号,只有碰到嵌套的时候才会同时用两种引号。即外面是单引号的时候里面就要用双引号,外面是双引号的时候里面就要用单引号,总之不能同时用双引号或者是单引号;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn