Onclick function not working in this case:
HTML
<img src="http://www.simplypo.ayz.pl/wp-content/uploads/2017/07/krakow-
3.png" id="gabi" style="text-align: justify;" onClick="myFunction()" />
<p id="demo">Hi!</p>
JS
function myFunction() {
var str = document.getElementById("demo").innerHTML;
var res = str.replace("Hi", "Hello");
document.getElementById("demo").innerHTML = res;
}