toolman Posted March 7, 2013 Share Posted March 7, 2013 Hi, Is it possible to give the below TR id="101" a class based on the span class of "pr9"? Basically I want to highlight the TR that contains a span class of "pr9" <tr id="101" class=""> <td id="eprio101" class="prio"> <span class="pr9" title="">9</span> </td> </tr> Is that possible? Thanks Link to comment https://forums.phpfreaks.com/topic/275386-possible-selector-question/ Share on other sites More sharing options...
gizmola Posted March 7, 2013 Share Posted March 7, 2013 With javascript you can. Here's a jsfiddle of how to accomplish this easily with jquery: http://jsfiddle.net/gizmola/TS4QE/10/ Essential code: $(".pr9").parents("#101").addClass("hilight"); Link to comment https://forums.phpfreaks.com/topic/275386-possible-selector-question/#findComment-1417350 Share on other sites More sharing options...
haku Posted March 8, 2013 Share Posted March 8, 2013 Yes. CSS will not work the way you want - highlight all X that contain Y - it will only work the other way around - highlight all Y that are within X. Link to comment https://forums.phpfreaks.com/topic/275386-possible-selector-question/#findComment-1417447 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.