• 0

Java Script to spot out the css-class


Question

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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.