Jump to content

Javascript Tag Dectection


BillyBoB

Recommended Posts

I suppose you could search for the string <img within your string.

 

// Not tested
var aString = "this contains an image <img src='myimg' /> in it";
if( aString.search( "<img" ) != -1 ){
  alert("has image");
}

 

I have a feeling that's not going to give you what you want.  Are you trying to find a specific image within the page?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.