blm126
05-18-2007, 01:34 AM
Hi, you guys. I've been messing around with using javascript to find elements based on CSS for a couple weeks now(to learn a little JS and CSS). You can see my progress here (http://code.google.com/p/findcss).Here's my question. Given the following HTML and CSS statement, what exactly is matched?
div > *:nth-of-type(1)
<div>
<div>Test tag</div>
<p>Test paragraph</p>
</div>
Will both tags be matched because they are both the first of their type, or will just the div match because the given tag is a wildcard? Hope you can help.
PS: Just for reference - http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#nth-of-type-pseudo
div > *:nth-of-type(1)
<div>
<div>Test tag</div>
<p>Test paragraph</p>
</div>
Will both tags be matched because they are both the first of their type, or will just the div match because the given tag is a wildcard? Hope you can help.
PS: Just for reference - http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#nth-of-type-pseudo