libsfan01 wrote on 16 jan 2007 in comp.lang.javas cript:
>
Evertjan. wrote:
>I doubt that, please show a working nonworking example.
Ok
You say "ok" but I don't see that example.
When i put the display:none; command in the actual element e.g.
style='display: none;'
It is called an inline style setting, not a command.
it does work fine but when i put it in the css at
the top of the page (above the javascript, as a style applied to the
elements id)
it wouldnt work? is there something wrong with the way i
was initially laying out the code on the page?
How could we know if you keep the actual code secret?
Try:
=============== = test.html tested on IE7 ===============
<style type='text/css'>
#myId1 {display:none;}
.myClass {display:none;}
</style>
<div id='myId1'>This is it</div>
<button
onclick =
'alert(document .getElementById ("myId1").style .display);'>
click</button>
<div id='myId2' style='display: none;'>This is it too/two</div>
<button
onclick =
'alert(document .getElementById ("myId2").style .display);'>
click</button>
<div id='myId3' class='myClass' >This is it three</div>
<button
onclick =
'alert(document .getElementById ("myId3").style .display);'>
click</button>
=============== =============== =============== ===========
When you test and analyze the above,
now you know where the problem lies,
you can easily work aroud it, don't you think?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)