How to get all <img> tags inside a text selection?

Posted by CyberShadow on Stack Overflow See other posts from Stack Overflow or by CyberShadow
Published on 2010-05-08T08:13:50Z Indexed on 2010/05/08 8:18 UTC
Read the original article Hit count: 206

Filed under:
|
|

I've looked around for a while, but there doesn't seem to be a simple way to do this. jQuery doesn't help the in least, it seems to entirely lack any support for selection or DOM ranges. Something which I hoped would be as simple as $.selection.filter('img') seems to only be doable with dozens of lines of code dealing with manually enumerating elements in ranges and browser implementation inconsistencies (though ierange helps here). Any other shortcuts?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery