在标签中标记 [英] tag with in tab

查看:133
本文介绍了在标签中标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个< button>标签,我在其中添加了< img>标签.

我的要求是,当我单击按钮标记上的文本时,我将调用一个javascript函数,而当我单击图像时,我将调用另一个javascript函数.
我的问题是我无法调用单独的函数.
IE.即使单击图像,也会调用按钮文本功能.

I have a <button> tag, within that tag I included <img> tab.

My requirement is that when I click the text on button tag I will call a javascript function and when I click the image I will call another javascript function.

My problem is that I couldn''t call separate function.
ie. even when I click the image then button text function is called.

Can you please help me in resolving this problem of mine?

推荐答案

首先,您是否可以将图像标签放在按钮标签中?

其次,对Image和button都进行JS调用(一种常用方法).在JS调用中,检查是哪个控件发起的-图像或按钮.基于此调用,将根据您的流程使用不同的方法.
First of all, were you able to put an image tag inside a button tag?

Second, put a JS call for Image and button both (a common method). In the JS call, check which control originated it - Image or Button. based on this call different methods based on your flow.


这篇关于在标签中标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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