tagName的使用,留一笔
时间:2021-07-01 10:21:17
帮助过:32人阅读
<SCRIPT LANGUAGE="JavaScript">
<!--
function TagSample(s)
{
var source=event.srcElement;
if (source.tagName.toUpperCase() == "IMG")
{
if (s == 1)
{
source.style.border="1px solid #0000FF";
}
else
{
source.style.border="";
}
}
}
//-->
</SCRIPT>
<div onMouseOver="TagSample(1)" onMouseOut="TagSample(0)">
<IMG SRC="images/logo.gif" WIDTH="190" HEIGHT="70" BORDER="0" ALT="">
</div>