Handling onmouseover in a Style Sheet

Giganews Newsgroups
Subject: Handling onmouseover in a Style Sheet
Posted by:  Bk Chockalingam (bk.chockaling…@focsinc.com)
Date: Tue, 08 Jul 2003

Hello,

I was hoping someone can explain this to me.  I'm using CSS and I'm =
trying to handle the onmouseover event but I'm getting an unexpected =
result.  Here's what my code looks like

..........<head><title></title>
<style>
#style1{...}
#style2{...} ... upto #style9{...}
</style> </head>
<body>
<script>
        function updatepage(){
                document.write("<div id=3D"style2........</div>")
                document.write("<div id=3D"style5.........</div?")
        }

<!-- If I use the following statement, the call to updatepage() makes it =
write to a new document.  But I
want it to udpate parts of the current document (i.e.) style sheets 2 =
and 5 -->
        document.write("<div id=3D"style1" onmouseover=3D"updatepage()" =
..........</div>")

<!-- If I use the following statement, then it works as intended. But I =
don't have the mouseover funcionality-->
        updatepage()
......</body>.....

Any idea what's going on here? =20
      =20

--=20
Thank you.
=20
Regards,
=20
Bk.
-----

Replies