[Javascript] CSS and Javascript
flavio
flavio at economisa.com.br
Mon Apr 4 07:44:58 CDT 2005
Abyss,
I got a few hints too:
* As your JS in in the "HEAD", when it runs "document.all.soldOrderBlock"
doesnt even exists yet, use the window.onload hint
* document.all is IE crap.
Try " myObject = document.getElementById('myIdHere'); " it'll be browser
compliant and a lot cleaner.
Hope to help,
--
Flavio Gomes
flavio at economisa.com.br
Citando Abyss <info at abyss.ws>:
> Hi All
>
> Im trying to (with complete failur) to hide a span when the page loads
>
> but to display it when a certain drop down box menu is selected.
>
>
> <span id="soldOrderBlock"></span>
>
> JS code in head
>
> if (document.all)
> {
> document.all.soldOrderBlock.style.display='none';
> }
> else
> {
> document.layers['soldOrderBlock'].style.display='none';
> }
>
> and calling the JS fuction like this
>
> showHideSelection();
>
> from the head
>
> I do not want to - I cannot - use the onload part of the body because of
> certain bad design specs..so can anyone see what I am doing wrong?
>
> it works with the onchange on the drop down box, just not when the page
> loads.
>
> can anyone suggest as to why?
>
> Thanks heaps...
> Abyss
------------------------------------
Mensagem enviada pelo WebMail Netsol
More information about the Javascript
mailing list