Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7736873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:51:14+00:00 2026-06-01T07:51:14+00:00

All the answers I could find recommended adding display:none to css… but for a

  • 0

All the answers I could find recommended adding display:none to css… but for a user without javascript, they will never see the element.

jQuery(document).ready(function($){

    $('#toggleElm').hide();

    $('#toggleBtn').click(function(){
        $('#shareLink').slideToggle();
    })

});

still results in an element that appears and disappears during page load because the page begins rendering before the DOM has finished these days.

<script type='javascript'> 
    document.write("<style type='text/css'> #toggleElm {display:none} </style>");
</script>

at the top of the body just seems too hacky.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:51:15+00:00Added an answer on June 1, 2026 at 7:51 am

    to prevent the javascript FOUC and let your page fully accessible you should apply a .no-js class in <html> element and then use that class to style your elements, exactly as html5 boilerplate+modernizr do

    #toggleElm { display: none; }
    .no-js #toggleElm { display: block; }
    

    of course you have to remove that class via javascript soon in the <head> of your document, with a script like this

    <script>
        (function(d) { 
            d.className = d.className.replace(/(^|\b)no\-js(\b|$)/, 'js');
        }(document.documentElement));
    </script>
    

    so if javascript is enabled, it will turn the .no-js class into .js class.

    Using this approach, your page is still accessible even when javascript is not available, because in that scenario the last CSS rule will be applied, leaving your elements visible and accessible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've read all the answers on to this questions and none of the solutions
I know this has been asked before but all the answers I found didn't
I've seen this question a few times, but all the answers rely on having
I know this question already have been asked. But I could not find any
I've searched all over and couldn't find an answer to this seemingly common question,
I'm having problems wrapping text within my container. I've already searched and all answers
edit: many thanks for all the answers. Here are the results after applying the
Thanks for looking, all helpful answers are voted up. This is my markup. I'm
I've read around the subject of temporary tables and scope and all the answers
Excuse me if I'm being too much of a beginner but none of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.