contains() not working

contains() not working


I have an image tag as
<img id="myimg" src="images/expand.jpg" />
I am trying as
if($("#myimg").attr("src").contains("expand"))
// do something
else
//do something else
but it gives an error "Object doesn't support this property of
method". Please help.