I 've got an image in my application. I try to change this image to another by onclick event, but I don't know why it doesn't work. Here is my code:
<body>
<div>
<img onclick="click()" src="http://chittagongit.com//images/smile-icon/smile-icon-6.jpg" id="smile">
</div>
<script>
function click () {
document.getElementByID("smile").src = "http://chittagongit.com//images/smile-icon/smile-icon-5.jpg"
}
</script>
The same code at codepen: https://codepen.io/szczypkamaciek/project/editor/DBrPbw
Thanks for help!!!