Passing div object id's to functions

by "John Murray" <jmnc(at)lis.net.au>

 Date:  Wed, 11 Oct 2000 16:19:40 +1000
 To:  <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
I know I'm missing something simple, and probably being lazy, but I start
from the perspective that the guys who set up DHTML would know we would want
to do this.
#####################
<html>
<head>
<style>
.thedivs {
color:"#ffffff";
}
</style>

<script type="text/javascript">
var divid;
function alertthez(divid){
    alert(divid.style.zIndex);
    }

</script>

<body>
<div id="fred" style="color:"#333333" onClick="alertthez('fred');">
blah blah
</div>
</body>
</html>
###################
yet it falls over with "style.zIndex is not an object"

It is so fundamentally necessary that there must be some syntax to pass the
id value into the function. What am I mising?

John

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA