Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
Check to see if the user's browser does not support javascript without <noscript>

I wanted to make my website display something if they don't use JavaScript. I know you could use the <noscript> tag but if I have CSS on my page I want it to clear my CSS so you could read the text.

function test()
{
  alert("you are using javascript!");
}
body
{
  background-color:#200;
}
<input type="button" value="Click Me with JavaScript" onClick="test()">

<noscript>You liar! You don't have JavaScript!</noscript>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The easiest thing to do is create a small css file to have the noscript CSS, like below. Note you can style the text as you want. This is just an example. You can even add your css that you want to run only in no script environment in this sheet

body:before{
    content: 'Please turn on Javascript';
    color: white;
    font-family: sans-serif;
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    width: 100%;
    padding: 1em 0;
    background: rgba(0,0,0,0.9);
}

Then add the following HTML

<noscript>
    <link rel="stylesheet" type="text/css" href="noscript.css">
</noscript>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!