什么html标签支持onload / onerror javascript事件属性? [英] What html tags support the onload/onerror javascript event attributes?

查看:160
本文介绍了什么html标签支持onload / onerror javascript事件属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我熟悉 onload 的典型用法,如下所示:

I'm familiar with the typical use of onload, as in the following:

<body onload="alert('Hello, World!');">
...
</body>

什么是触发加载事件的所有html元素? (因此在onload属性中执行javascript)

What are all the html elements that fire a load event? (thus executing javascript supplied in an onload attribute)

例如, img 就是一个这样的标签,它将执行当 some.png 已加载时,在 onload 属性中提供的javascript:

For example, img is one such tag that will execute the javascript supplied in an onload attribute when some.png has loaded:

<img onload="someImgLoaded()" src="some.png" />


推荐答案

'onload'受以下HTML标记支持:
$ b

'onload' is supported by the following HTML tags:


< body> ;,< frame> ;,< frameset> ;,< iframe>< img>,< link> ;,< script>

以下Javascript对象: p>

And the following Javascript objects:


图片,图层,窗口

image, layer, window

这篇关于什么html标签支持onload / onerror javascript事件属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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