Ir ao conteúdo
  • Cadastre-se

Danielpavao

Membro Júnior
  • Posts

    1
  • Cadastrado em

  • Última visita

posts postados por Danielpavao

  1. Quando aperto o botão só dá o resultado de "ELSE"! Mesmo se o "IF" está certo (Formulário de Login).

     

    <CODE>
    
    
    
    <!DOCTYPE html>
    
    <html lang="pt-br">
    
    <head>
    
        <meta charset="UTF-8">
    
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
        <title>Form Contato</title>
    
    </head>
    
    <style>
    
        *{margin: 0;padding: 0%;box-sizing:border-box;}
    
        body{
    
            background-color: cornflowerblue;
    
        }
    
        form{
    
            background-color: cornsilk;
    
            max-width: 500px;
    
            width: 70%;
    
            padding:20px;
    
            position: absolute;
    
            left: 50%;
    
            top: 50%;
    
            transform: translate(-50%,-50%);
    
        }
    
        form h3{
    
            text-align: center;
    
            color: crimson;
    
            font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    
        }
    
        form input[type=email],
    
        form input[type=password]{
    
            width: 100%;
    
            height: 45px;
    
            border: 1px solid #cccccc;
    
            padding-left: 10px;
    
            margin: 10px 0;
    
        }
    
        button[type=submit]{
    
            width: 100%;
    
            height: 30px;
    
            cursor: pointer;
    
            background: crimson;
    
            color:white ;
    
            border: 0;
    
            border-radius: 20px;
    
            transition: 1s;
    
        }
    
        form input[type=submit]:hover{
    
            background-color: crimson;
    
        }
    
    </style> 
    
    <body>
    
        <form>
    
            <h3>Formulario Para Contato</h3>
    
            <input type="email" id="emailus" name="E-mail" placeholder="Digite seu E-mail" required/>
    
            <input type="password" id="senhaus" name="senha" placeholder="Digite sua Senha..." required/>
    
            <button type="submit" onclick="funçaoParaExecutar()">Entrar</button>
    
        </form>
    
        <script>{
    
                    function funçaoParaExecutar () 
    
                    {
    
                        let email = document.getElementById('emailus')
    
                        let password = document.getElementById('senhaus')
    
    
    
                        if(email == "[email protected]" && password == "1519")
    
                            { 
    
                                alert('DENTRO')
    
                            }
    
                        else{
    
                                alert('fora')
    
                            }
    
                     }
    
                }
    
        </script>
    
    </body>
    
    </html>

     

    Screenshot (75).png

    Screenshot (78).png

    Screenshot (79).png

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...