Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-24-2009, 08:09 PM #1
- Join Date
- Mar 2009
- Thanked 0 Times in 0 Posts
Finding name-and-id-less elements?
Hi. I am messing around with some GreaseMonkey scripts to clean up some websites that I use a lot, and am having trouble dealing with some of their bad HTML. For example, I would like to address a table cell's properties, but can't for the life of me figure out how to find/address that cell, because it has no name or ID, is inside a row with no name or ID, inside a table with no name or ID, inside a DIV with no name or ID. :/
There IS an image inside it that has an ID attribute, so I am thinking maybe I can start from their and move 'up' to the parent TD, but I can't figure out how to do that either.
As a stripped down example, how could I set the (for example) background-color of the TD that contains the anchor and image in this code snip? The image is the only thing with an ID here....
<div> <table> <tr> <td> <a href="#"><img src="banner.jpg" name="header" id="headerGraphic"></a> </td>
03-24-2009, 08:28 PM #2
- Join Date
- Mar 2007
- Thanked 2,224 Times in 2,211 Posts
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)