What's the xui.js (or pure javascript if necessary) alternative for jQuery's .children()
.
To be more specific, I'm trying to get the child of $x(this)
but $x(this).children('p')
doesn't work (as in, it doesn't seem to exist in the library. It's not recognized according to Firebug nor is it in the xuijs docs).
Not sure about that library, but if you have the native DOM element, the native JS could look like this:
If you're supporting legacy browsers, you can get a shim for
Array.prototype.filter
from MDN.https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter#Compatibility
And you can easily make a reusable function too.
It only filters by tag name, but it would be simple to extend it.