Re: [DOM4] parent method

Are you referring to the parents() method? I was under the impression that parent(selector) only grabbed the parent node if it matched the selector, while parents() would go up the ancestor tree.

2. What should happen in the following cases? My intuition is that they should all return either null or node.parentNode, but I don't feel strongly.
-node.parent("")
-node.parent(undefined)
-node.parent(null)
-node.parent(5)

I would expect the same functionality as document.getElementById—all of your examples would return null.

Received on Sunday, 18 December 2011 12:22:31 UTC