HTML img onclick Javascript

前端之家收集整理的这篇文章主要介绍了HTML img onclick Javascript前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何使用ONCLICK事件在新的WINDOW中打开 JavaScript的当前图像.
<script>
 function imgWindow() {
  window.open("image") }
</script>

HTML

<img src="pond1.jpg" height="150" size="150" alt="Johnson Pond" onclick="image()"> <-- Have JavaScript open this image with onclick.
<img src="pond2.jpg" height="150" size="150" alt="All-green Pond" onclick="image()"> <-- Have JavaScript open this image with onclick.
<img src="pond3.jpg" height="150" size="150" alt="Dutch Pond" onclick="image()"> <-- Have JavaScript open this image with onclick.

解决方法

干得好.
<img src="https://i.imgur.com/7KpCS0Y.jpg" onclick="window.open(this.src)">
原文链接:https://www.f2er.com/html/227888.html

猜你在找的HTML相关文章