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
img
tag and return
true

Answer Source

using regex:

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