regedarek regedarek - 10 months ago 52
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/)