Not really sure how to phrase this question so it’s generic enough. (and will rephrase, after I know what I’m asking). The problem, I believe deals with variables in a JQuery .find() function.
Problem: you can wrap $() around an array of DOM elements, or around a jQuery object, but not around an array of jQuery objects
The best I can do, at this time, is provide an example here
The problem code in the previous fiddle, is here:
////////////////Neither of the following works////////////////
//nodelevel = nodesWithMinuses.find('div.node.level' + levelnumber);
nodelevel = $(nodesWithMinuses).find('div.node.level' + levelnumber);
////////////////Neither of the previous works////////////////
Apparently you can wrap
$()around an array of DOM elements, or around a jQuery object, but not around an array of jQuery objects.Try changing this line:
to this:
This will extract the DOM element and turn
nodesWithMinusesinto an array of DOM elements.