jquery and strings

jquery and strings

there is a way to know how much X elements are appearing inside a string?

i tried this one:
$(msg).find('img').length

but no success