+ 5
[data-*] css / js
I append to a table some <tr> with for each data-tr="tr-*", where * is the number of the index of the tr in the table. so there is tr-1, tr-2, tr-3 etc... how in css could I take this : [data-tr=tr-*] { opacity: 0; } I don't want to use [data-tr] { opacity: 0; }
6 Réponses
+ 2
NoxFly ドリアン I found something about the data attributes in classes. Look here: https://css-tricks.com/almanac/selectors/a/attribute/
+ 4
oh ok thanks !
+ 4
lol 😁 you're welcome too :p
+ 3
oh, if you want to use classes it's same. I want say all classes tr-* (a number)
have opacity 0. and I want to select just one of them to opacity 1. not to select all
+ 2
NoxFly ドリアン you're welcome
BTW I didn't know you could do that, so I learnt something too
0
NoxFly ドリアン why instead of "data-tr" don't you use classes?