Reputation: 1496
Can anybody tell me why the following code (also see jsfiddle) does not replace 1tw.gif with 2tw.gif? It should show "2" instead of "1"...
<img id="pic" src="http://www.drewgreenwell.com/images/sample/1tw.gif" alt="" width="90%"/>
<script>
$(document).ready(function(){
$('#pic').attr('scr', 'http://www.drewgreenwell.com/images/sample/2tw.gif');
});
</script>
Thank you!
Upvotes: 0
Views: 57
Reputation: 82251
You have typo. scr
should be src
:
$('#pic').attr('src', 'http://www.drewgreenwell.com/images/sample/2tw.gif');
Upvotes: 4