I tried doing
var div = document.createElement('div');
var nodeList = new query.NodeList();
nodeList.push(div);
nodeList.children(".someClass");
// I get error Uncaught TypeError: Object [object HTMLDivElement] has no method 'children'
So I’m guessing I have to convert the html element to a dojo Node element? How do you do this?
Also, do you know of a better way to query an element’s children nodes (based on children’s classNames), when given a parent as an htmlElement variable with no id or class, and children with classNames?
thx to craig swing for the explanation
When you read Node in the documentation, it is referring to a dom node and not anything specific to Dojo.
If you are looking to create a new dom node, then you should use dom-construct.
http://dojotoolkit.org/reference-guide/1.7/dojo/dom-construct.html
Given a particular node, you can query for all of its children using the following:
http://dojotoolkit.org/reference-guide/1.7/dojo/query.html#dojo-query