BoaVista Posted August 17, 2004 Share Posted August 17, 2004 Hi, I have the following JSCript with which I would like to spot out the css-class of objects while I moving with my mouse. But it does not work ... could you find any error in that script ? Thx <script language="jscript"> function ClassInfo() { if (window.event.srcElement.className != null) { stsclass.innerText = win-dow.event.srcElement.className; } else { stsclass.innerText = ""; } } window.document.body.onmouseover = ClassInfo;</script> <div style="border-style:solid;border-width:1px; width: 281px; height: 34px; position: absolute; left: 286px; top: 41px; z-index:15; pad-ding-left:4px; padding-right:4px; padding-top:2px; padding-bottom:2px; back-ground-color:#EEEEF4"> <p id="stsclasstitle"><font face="Tahoma" id="stsclasstitle">Classname: </font> <font face="Tahoma"id="stsclass"> </font> </p></div> Link to comment Share on other sites More sharing options...
0 BoaVista Posted August 17, 2004 Author Share Posted August 17, 2004 error found :-) thx anyway!! remove the "-" between win-dow.event.srcElement and it works perfect //BoaVista Link to comment Share on other sites More sharing options...
0 Japlabot Posted August 17, 2004 Share Posted August 17, 2004 win-dow ? oma"id="sts ? edit: too late, way too late, took my time and was way way too late :| Link to comment Share on other sites More sharing options...
Question
BoaVista
Hi,
I have the following JSCript with which I would like to spot out the css-class of objects while I moving with my mouse.
But it does not work ... could you find any error in that script ?
Thx
<script language="jscript">
function ClassInfo()
{
if (window.event.srcElement.className != null)
{
stsclass.innerText = win-dow.event.srcElement.className;
}
else
{
stsclass.innerText = "";
}
}
window.document.body.onmouseover = ClassInfo;</script>
<div style="border-style:solid;border-width:1px; width: 281px; height: 34px;
position: absolute; left: 286px; top: 41px; z-index:15; pad-ding-left:4px;
padding-right:4px; padding-top:2px; padding-bottom:2px; back-ground-color:#EEEEF4">
<p id="stsclasstitle"><font face="Tahoma" id="stsclasstitle">Classname: </font>
<font face="Tahoma"id="stsclass"> </font>
</p></div>
Link to comment
Share on other sites
2 answers to this question
Recommended Posts