I want to change my img src with jQuery click function but can't seem to do it. Here is my html code:
<div id="main2"><img id='mty' style="width: 500px;height: 600px;"
src="https://cdn.pastemagazine.com/www/articles/morty%20main.jpg">
</div>
Here is my jQuery code that won't work:
<script type="text/javascript">
$('#paper').click(function()
{
$('#mty').attr('src', 'http://www.cliparthut.com/clip-arts/1008/paper-stack-clip-art-1008442.jpg');
}); </script>
what am I doing wrong? I want to be able to change the html src if I click on #paper which is a button btw.