我有这个按钮:为什么这个inline stopPropagation方法调用不起作用?
<button
type="button"
onclick='parent.parent.ExecuteCommand(14);event.stopPropagation()'
class="button_air-medium">
<img
id="selectMode"
class="shortcutContant"
src="../stdicons/icon_select.gif">
</button>
正如你可以看到里面onclick属性我叫两个功能ExecuteCommand
和stopPropagation
。
执行命令工作正常,但在我看来,stopPropagation
方法没有被触发,因为该按钮下的元素会受到影响。
任何想法为什么stopPropagation方法不起作用?
我想'stopPropagation()'属于jQuery的。相反,只需使用'return false;'它应该诀窍 – ihpar
你需要问自己这里的问题是在这种情况下'事件'是什么? – Liam