Stevio wrote:
I have some content that is hidden and only displayed using JavaScript. However, when JavaScript is disabled, I want to display all of the content to start with.

I can do this by redefining styles within a noscript tag within the head section. Display: none is changed to Display: block for the various elements. However, my page does not then validate as being valid XHTML 1.0 Transitional code when I do this. It doesn't like the style declaration within the noscript tags. In fact, am I right in saying that .

What can I do to display hidden content which will be valid XHTML 1.0 Transitional other than my solution above?

<style type="text/css"> p { display: block; } </style> <script type="text/javascript"> function changeStyles() { if ( document.styleSheets ) { var ruleName = (document.all)? 'rules':'cssRules'; document.styleSheets[0][ruleName][0].style.display = "none"; } } changeStyles(); </script> </head> <body>

<p>lorem ipsum etc.</p>

... etc.

Tested in FF and IE6, at least... :-)

--
Hassan Schroeder ----------------------------- [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                          dream.  code.


****************************************************** The discussion list for http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to