1
resposta

Saber se fiz certo o desafio interagindo com HTML

Olá, boa noite! Me chamo Henrique.

Por favor, gostaria de saber se fiz certo o desafio interagindo com HTML. Agradeço desde já;

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <header>
        <h1></h1>
    </header>
    <main class="container">
        <button onclick="buttonVerify()" class="button">Botton</button>
        <button onclick="alertLove()" class="button">Alert</button>
        <button onclick="cityBr()" class="button">Prompt</button>
        <button onclick="bottom3()" class="button">Soma</button>
    </main>

      <script src="app.js"></script>
</body>
</html>

Javascript:

let titulo = document.querySelector("h1");

titulo.innerHTML = "Hora do desafio 2";

function buttonVerify() {

    console.log("O botão foi clicado")
    
    }

function alertLove() {

        console.log("Eu amo JS")
        
        }

function cityBr() {

        prompt("Qual a cidade do Brasil?");
        alert("Estive em São Paulo e lembrei de você");
        }

function bottom3() {

        let numOne = prompt("digite um número");
        let numTwo = prompt("digite outro número");
        numberOne = parseInt(numOne);
        numberTwo = parseInt(numTwo);
        let sum = numberOne + numberTwo;
        alert("A soma de " + numberOne + " e " + numberTwo + " é igual a " + sum);
        }

1 resposta

Olá Henrique. Muito bom código!