regedarek regedarek - 5 months ago 33
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/)