문제

I want to select elements with the class .group .level3

Here is what I have now

var level = 3;
Y.all(".group" '.level'+[levelnumber])

That is what I have now but don't know where all the quotation marks should go.

Thanks!!

도움이 되었습니까?

해결책

Remove the square braces

Also you have some syntax errors with the statement. ".group .level" is a string and you want to concatenate a variable to it

Y.all(".group" '.level'+[levelnumber])
             ^ ^      ^ ^           ^
             ------------------------   Get rid of these

Y.all(".group .level"+ levelnumber)

You generally tend to use [] to access a specific index in Array like objects.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top