I have a jQuery variable as the following
var $data = "<li id='root'><a href='#'>Root node</a><ul><li><a href='#'>Child node</a></li></ul></li><li id='root2'><a href='#'>Root 2 node</a><ul><li><a href='#'>Child 2 Parent Node</a><ul><li><a href='#'>Child 2 child1</a></li></ul><ul><li><a href='#'>Child 2 child2</a></li></ul></li></ul></li>";
I want to fetch the values of each <a href=#> values and push it into an array.
Can any body help???
Demonstration (open the console)