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 Quote 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"); Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/275386-possible-selector-question/#findComment-1417447 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.