Bookin Bookin - 1 year ago 62
Javascript Question

Get tag if src have value

I use this:


So I need remove img, if src have special url, but problem with html like this:

<img src=""/>
<p>Text text text</p>
<img src=""/>

Will be remove all tags, but I need only last img tag.

Example -

Answer Source

Instead of using [\s\S] which means anything you can use [^>]:


See it live

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download