Reputation: 49
I am trying to call the function by this way, but onclick() is not working in the below code.
<img id="myImg" src="uploads/15051139151863de8020740a7899d26ead30d24770.jpg" onclick="modalview()" width="300" height="200">
Upvotes: 2
Views: 16478
Reputation: 8551
Correct syntax:
<img src="http://example.com" onclick="function()">
Or you can use extern call like this:
$("img").click(function() {
alert("Image clicked");
});
Upvotes: 2