Pregunta

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!!

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top