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

257
Visualizações
how do I get the value of an input and use it in an if-then statement?

I want to make a currency redeemer in my file. I am trying to use javascript to get the input of the text, but I get the same messages: Syntax Error and Reference Error. What does this mean and how do I fix it?

Here is my exact code:

<html>
    <head>
        <title>Alante de Nuza - Made in Nuza</title>
        <script>
            function onClick1() {
                if document.getElementById("Input1").value == "C120CC9" {
                    document.getElementById("Paragraph1").innerHTMl = "Code Succesful!";
                } else if {
                    document.getElementById("Input1").value == "X999XX9" {
                        document.getElementById("Paragraph1").innerHTMl = "Very Sneaky...";
                    }
                }
            }
            
        </script>
    </head>
    <body>
        <h1 style="font-family:cursive;">Alante de Nuza redeem</h1>
        <hr>
        <input id="Input1" type="text" placeholder="e.g. X999XX9" style="width:500px; height:100px; font-size:70px; text-align:center;">
        <br>
        <br>
        <button onclick="onClick1()" style="border-radius:50px; text-align:center; font-size:60px; font-family:cursive; width: 300px; height:100px;">REDEEM</button>
        <p id="Paragraph1"></p>
    </body>
</html>
about 4 years ago · Juan Pablo Isaza
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