Using a prototype JS library, I want to select all the child elements of links (tags A) regardless of whether their parent is: H1, H2, H3, H4 or H5 (etc.) using a simple CSS Selector rule (in unlike further JS, such as loop, etc.).
So, a simple but long way:
$('page').select('h1 > a, h2 > a, h3 > a, h4 > a, h5 > a')
I think I'm looking for a wild-card property, for example h *, which does not exist.
Perhaps the above example is the way to go, but I hope there is a simpler, shorter, and more efficient way to do this.
Tips appreciated.
javascript prototypejs css-selectors
donohoe
source share