Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想选择.group .level3类的元素
这是我现在拥有的
var level = 3; Y.all(".group" '.level'+[levelnumber])
这就是我现在所拥有的,但不知道所有引号应该放在哪里。
谢谢!!
去掉方括号
该语句还有一些语法错误。".group .level" 是一个字符串,您想将一个变量连接到它
Y.all(".group" '.level'+[levelnumber]) ^ ^ ^ ^ ^ ------------------------ Get rid of these
Y.all(".group .level"+ levelnumber)
您通常倾向于使用[]对象来访问 Array 中的特定索引。
[]