:last-child with text elements
I'm trying to find the trailing
<br/>s from a
<p> using the '
br:last-child' selector and I find surprising that in a context like:
$('p br:last-child') returns the <br/> although there is a text node after it. I suspect there may be an issue because if you get the returned <br/>:
- <p>some text<br/>and some more text</p>
and get its parent's last child walking the DOM properties:
- var br = $('p br:last-child');
you get the text node containing "and some more text".
So, should the <br/> in this context match or not?