惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
TaoSecurity Blog
TaoSecurity Blog
H
Heimdal Security Blog
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
V2EX - 技术
V2EX - 技术
博客园 - 【当耐特】
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Secure Thoughts
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
有赞技术团队
有赞技术团队
S
Schneier on Security
S
SegmentFault 最新的问题
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives
IT之家
IT之家
Project Zero
Project Zero
博客园 - 司徒正美
P
Privacy International News Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Security Latest
Security Latest
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
L
Lohrmann on Cybersecurity

博客园 - I Believe

哲理 Win PE(帮老马研究下) TCP/IP协议基础 connect by prior Gis基础知识 javascript和jscript的区别 javascript常用代码大全(转贴) - I Believe - 博客园 三维场景中的实时动态云彩绘制方法 正则表达式 名言 div和span 面向对象 document.all HTML语言的发展 C/S和B/S 微软Visual Studio2005开发工具路线图详解 (转发) 空间坐标系统的种类 OLE和activex 励志篇(程序员)
window.event.srcElement
I Believe · 2006-11-10 · via 博客园 - I Believe

<input type=button value=ok onclick="mm()">

<s cript LANGUAGE="Javas cript"><!--
function mm()
{
var str = "";
for (mm in window.event.srcElement)
str += mm+"="+ window.event.srcElement[mm] +"\n"; //得到 srcElement 的所有属性
alert(str);
}
//--></s cript>

event.srcElement就是指向触发事件的元素,他是什么就有什么的属性

srcElement 是事件初始目标的html元素对象引用,因为事件通过元素容器层次冒泡,可以在任一层进行处理,所以由一个属性指向产生初始事件的元素是很有帮助的.有了元素的引用,就可以读/写改元素的属性,并调用他的任何方法.

<HTML>
<HEAD>
<TITLE>srcElement Property</TITLE>
<STYLE TYPE="text/css">
.bold {font-weight:bold}
.ital {font-style:italic}
</STYLE>
<s cript LANGUAGE="Javas cript">
function highlight() {
 var elem = event.srcElement
 if (elem.className == "bold") {
  document.styleSheets[0].rules[0].style.color = "red"
 } else {
  elem.style.color = "#FFCC00"
 }
}
function restore() {
 var elem = event.srcElement
 if (elem.className == "bold") {
  document.styleSheets[0].rules[0].style.color = ""
 } else {
  elem.style.color = ""
 }
}
</s cript>
</HEAD>
<BODY onMouseDown="highlight()" onMouseUp="restore()">
<H1>srcElement Property</H1>
<HR>
<P>One event handler...</P>
<UL>
<LI>Can
<LI>Cover
<LI>Many
<LI>Objects
</UL>
<P>
Lorem ipsum dolor sit amet, consectetaur adipisicing elit,
<SPAN CLASS="bold">sed do </SPAN>eiusmod tempor incididunt
<SPAN CLASS="ital">ut labore et </SPAN>dolore magna aliqua.
Ut enim adminim veniam, <SPAN CLASS="bold">quis nostrud
exercitation </SPAN>ullamco laboris nisi ut aliquip ex ea
<SPAN CLASS="bold">commodo consequat</SPAN>.
</P>
</BODY>
</HTML>

srcElement Attribute | srcElement Property

--------------------------------------------------------------------------------

Retrieves the object that fired the event.

Syntax

HTML < srcElement = oObject ... >
s cripting event.srcElement [ = oObject ]

Possible Values

oObject Object hat specifies the event that fired.

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft?Internet Explorer 5. For more information, see Dynamic Properties.