If you're intent is to sanitize HTML submitted by your users, I'm don't think HTML::DOM (or any other module that constructs a tree from the HTML before doing anything else) is the right route.
If not, here's what you asked:
for my $img ( $dom_tree->getElementsByTagName('img') ) { $img->delete(); }
Untested. Assumes getElementsByTagName returns HTML::Element objects.
In reply to Re: HTML::DOM traverse
by ikegami
in thread HTML::DOM traverse
by jai_dgl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |