PROBLEM: I am trying to remove the comment mark-up around an IMG element <!-- <img src="pic" /> -->. I tried using the :contains(text) selector but as a <!-- comment -> is mark-up, I need to do something like :contains(html).
CODE: $('element':contains("<!--").each( function() { var $this = $this() var t = $this.html() $this.html(t.replace('<--', '')); } ) NOTE: I have checked the replace function and it removes the <!-- just fine. My issue is how can I "contains(html)" or is there another way to do this? Another thing I have noticed, is there does not seem to be any way to selected a comment element with jQuery.