<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>GetElementByElement?</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>If I get you right, you should just need to give
this DIV an ID and call something like:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>setStyle("IDName", "display", "none")</FONT></DIV>
<DIV><FONT face=Arial size=2>// Where IDName is the ID of your DIV</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Now if you want to use this method to apply
multiple styles to a single element, it looks like you'll just need to make
multiple calls.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Chris Tifer</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=simeon@simeons.net href="mailto:simeon@simeons.net">Simeon
Willbanks</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@latech.edu
href="mailto:javascript@latech.edu">javascript@latech.edu</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, March 03, 2004 1:58
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Javascript]
GetElementByElement?</DIV>
<DIV><BR></DIV><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>
<P>
<HR>
<P></P>_______________________________________________<BR>Javascript mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE></BODY></HTML>