[sourcecode language=”java”]
$(".tooltips img").click(function () {
var _src = $(this).attr(‘src’);
alert(_src.indexOf("_off") != -1);
if(_src.indexOf("_off") != -1) {
$(this).attr(‘src’, $(this).attr(‘src’).replace(‘_off’, ‘_on’));
}else{
$(this).attr(‘src’, $(this).attr(‘src’).replace(‘_on’, ‘_off’));
}
return false;
});
[/sourcecode]