regedarek regedarek - 1 year ago 83
jQuery Question

What is the easiest way to check if string contains any image tag?

For example I have text:

"testestestestt testestestes <img src='image.jpg'>"

I want to write function which check if in string is
tag and return

Answer Source

using regex:

"testestestestt testestestes <img src='image.jpg'>".match(/<img/)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download