<HTML>
<HEAD>
<TITLE>GetElementByElement?</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana">Hello All,<BR>
<BR>
I grabbed a bit of code from a dhtml kitchen tutorial. I am trying to modify it to fit my needs. Below is the original code <BR>
<BR>
function setStyle(obj,style,value){<BR>
getRef(obj).style[style]= value;<BR>
}<BR>
<BR>
function getRef(obj){<BR>
return (typeof obj == "string") ?<BR>
document.getElementById(obj) : obj;<BR>
}<BR>
<BR>
You can then use an onclick event to set a style by id, and it works beautifully. <BR>
<BR>
<p class="link" onclick="setStyle('fixed','visibility','hidden')">Close The Ad</p><BR>
<BR>
What I need to do is change and element property along with an id property. In other words, set a div to display:none; and change the an element like body: padding-bottom: 0; <BR>
I don’t know if a function exists like getElement? Maybe than I could write a function to recognize the body element css properties in order to switch the properties? Has anyone tired to do this before? Any help would be appreciated.<BR>
<BR>
Thanks,<BR>
Simeon </FONT>
</BODY>
</HTML>