Help, the same with value at input worked, but not here, if that, here is a link to the page: duoxx.imtqy.com
<!DOCTYPE html> <html> <head> <title>Javascript Tutorial</title> <link rel="stylesheet" type="text/css" src="main.css"/> <script type="text/javascript"> function ClickButton (TypeImg) { if(TypeImg.src == "dor.gif"){ alert ("hello"); } } </script> </head> <body> <img alt="Doritos" src="dor.gif" onclick="ClickButton (this)" style="cursor:pointer;"/> </body> </html>
TypeImg.srcgets the full path to the image, because the equality is not performed. So either check for a complete match with the absolute path, or for an incomplete match with a regular schedule, or enter a dubbing attribute and check with it. - br3t