Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda