regedarek regedarek - 2 months ago 7
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
img
tag and return
true

Answer

using regex:

"testestestestt testestestes <img src='image.jpg'>".match(/<img/)