I am trying to change the image by clicking on it. I have written the codes and it's not working.
<div class="img fadeIn" >
<img src="logo.png" height="90px" width="320px" onclick="change()" id="koo" />
</div>
JavaScript code:
function change() {
var mySrc = this.getAttribute('src');
if( mySrc == 'logo.png' ){
this.setAttribute('src','logo1.png');
} else {
this.setAttribute('src','logo.png');
}
}