Let's say that I have two HTML elements: element1 and element2. They are created dynamically, so I can't use IDs:
<element1 class='class1' selected="true" ...[other_attributes]...>
<element1 class='class1' selected="true" ...[other_attributes]...>
<element1 class='class1' selected="false"...[other_attributes]...>
.................................................................
{other <element1> elements}
.................................................................
<element2 class='class2' selected="true" ...[other_attributes]...>
<element2 class='class2' selected="false"...[other_attributes]...>
.................................................................
{other <element2> elements}
Now, what I want to do, is to use the same attribute (selected) for element1 and element2, and when selected="true" on element1 to have one css, and when selected="true" on element2 to have different css. Maybe something like:
[selected=true]
{
color.red
}
[selected = true]
{
color.green
}
Except, I want to make it in a way that the HTML will recognize what css to assign on the different element.
I hope I was clear enough.
How do I do this?