This article describes the method of clicking on images to enlarge images in js. Share it for your reference. The specific implementation method is as follows:
Copy the code as follows: <html>
<title>Click the picture to enlarge the picture</title>
<body>
Click on the image to preview the effect. <br>
<img src="/images/m01.jpg" onclick="this.width+=50;this.height+=50" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/>
<img src="/images/m02.jpg" onclick="this.style.zoom='2'" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/>
</body>
</html>
I hope this article will be helpful to everyone's JavaScript programming.