How can I get an array or array-like (JQuery object) containing all the comment elements in the DOM?
JQuery contents()
only retrieve 1 level elements.
The broader problem: I need to remove all the elements between 2 text comments in my DOM. Comments can also be in child elements.
...html code...
<!--remove from here-->
...code...
<!--finish removing-->
...html code...
So after the method, HTML DOM should look like:
...html code...
...html code...
Thanks.