开发者

How to get the html object who called the onmouseover function method in JSP?

开发者 https://www.devze.com 2023-04-10 02:00 出处:网络
I write a html file with some JSP in it.A html tag has a onmouseover listener.And when the mouseove开发者_开发问答r method is called by moving mouse on the tag\'s innerhtml, how can I get the current

I write a html file with some JSP in it.A html tag has a onmouseover listener.And when the mouseove开发者_开发问答r method is called by moving mouse on the tag's innerhtml, how can I get the current html tag object? BTW,The "this" pointer is not pointing to the tag element.

function dosth(){  
   //TODO: get the object who calls this method.
}
....
<mytag onmouseover="dosth()">innerHTML</mytag>

In above example,how can i get the mytag node ? mytag is not allowed to have an id.


<mytag onmouseover="dosth(this);">innerHTML</mytag>

The first argument sent to dosth will be the element that called it.

0

精彩评论

暂无评论...
验证码 换一张
取 消