...

View Full Version : Finding if a value has a value - Does Image SRC contain a "1"?



isaaclloyd
03-24-2005, 08:46 AM
I am trying to figure out how to check if a value has a value. Like if an image src has a "1" in its value. Kind of like below even though this one doesn't work:


if(document.getElementById("MyID").src contains "1"){
DO THIS...
}
else{
Do THAT...
}


Any comments or suggestions are greatly apreciated. Thanks.


~Isaac Lloyd~

Kor
03-24-2005, 10:43 AM
if(document.getElementById("MyID").getAttribute('src').indexOf('1')>-1)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum