I’m attempting to use mootools’ .getFirst(); to select (naturally) the first element that matches a particular CSS3 selector. However, it doesn’t seem to work, and I am forced to fall back to using .getElement();, which also works as intended.
Note that .getElement(); returns the <li> element while .getFirst(); does not.
Anyone have any ideas?
Unfortunately it seems like
getFirstis not recursive, which means that for your example to work you’ll have to update it to$('foo').getFirst('* li');.http://jsfiddle.net/mqchen/NdWs9/2/