图片的Onclick事件 [英] Onclick event for the images

查看:105
本文介绍了图片的Onclick事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击图片后,我们想要在图片下添加一些文本

When an image is clicked ,then we want some text under the image

推荐答案

标签:HTML

因此,我们假设您具有HTML图像控件,而不是服务器控件.现在,在此处查看图像控件的事件: http://www.w3schools.com/tags/tag_img.asp [ ^ ]

使用``onclick''事件.定义它,然后在您的Javascript中进行处理.您将需要在JS中的图像下方找到标签,并设置其文本.

试试吧!
Tagged: HTML

So, we assume you have a HTML image control and it''s not a server control. Now, see the events of an image control here: http://www.w3schools.com/tags/tag_img.asp[^]

Use ''onclick'' event. Define it and then handle the same in your Javascript. You would need to find the label placed below the image in your JS and set the text of that.

Try!


这篇关于图片的Onclick事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆