Can someone explain this code for me

liunx

Guest
I don't understand the code between the <H3.........> part below. I know what it's supposed to do, but can someone explain it to me in plain English? I'm not sure especially about the "?" I am a VB programmer and am new to this stuff.<br />
<br />
<H3 OnClick="History.style.display=History.style.display=='none'? '':'none'"><br />
<br />
History<br />
<br />
<BR><br />
</H3><br />
<br />
ALSO<br />
<br />
I don't understand what the below code means. I understand what it does, but can't really put it in words.<br />
<br />
<DIV ID=History STYLE="display:none"><br />
<center><br />
<P><br />
<left><br />
INFOINFOINFO<br />
</left><br />
</P><br />
</center><br />
</DIV><!--content-->its checking if the div with an id of history's display is none or something else.<br />
History.style.display=='none'? '':'none' is making a decision. its basically going "is the history.style.display the same as none, if it is make it blank, otherwise make it none. it would be the same as writing<br />
if(History.style.display == "none")<br />
History.style.display = '';<br />
else<br />
History.style.display = 'none';<br />
<br />
but its a lot simpler<!--content-->Plain English? *lol* Okay. I'm not any great shakes at this stuff, but I'll give it a shot.<br />
<br />
<H3 OnClick="History.style.display=History.style.display=='none'? '':'none'"><br />
History<br />
<BR><br />
</H3><br />
<br />
H3 is a size and weight of text. It's a short way of writing <bold><font size="3">text</font size="3"></bold>.<br />
<br />
However, when you click on "History", the OnClick instructions say to remove that H3 styling. <br />
<br />
<DIV ID=History STYLE="display:none"><br />
<center><br />
<P><br />
<left><br />
INFOINFOINFO<br />
</left><br />
</P><br />
</center><br />
</DIV> <br />
<br />
Hmmm... "Make me a new section and call it "history" but don't display any style. Centre the section, but left align the paragraph." is pretty much what it says in English, but, to be honest, it's a bit out. <br />
<br />
<Div ID=History Style="display:none" align="center"><br />
<p align="left"><br />
INFOINFOINFOINFO<br />
</p><br />
</div><br />
<br />
is a bit neater, I think.<br />
<br />
From the sounds of it, there's a style sheet attached to the page and these commands exclude the style from the respective sections.<br />
<br />
*lol* But, as I say, I'm no great shakes at this stuff. I've been known to be wrong before.<br />
<br />
Peg<!--content-->
 
Back
Top