Jump to content

Derivan

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Derivan

  1. <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
        <H1> Calculadora</H1>
        <input type="button" value="Adição" onclick="adc()">
        <input type="button" value="Subtração" onclick="sub()">
        <input type="button" value="Mutiplicação" onclick="mult()">
        <input type="button" value="Divisão" onclick="dv()"> <br>
        <input type="number" name="nn1" id="nn1">
        <input type="number" name="nn2" id="nn2">
        <div id="resp">Resultado</div>
        <script>
            var ns1 = window.document.querySelector('input#nn1')
            var ns2 = window.document.querySelector('input#nn2')
            var res = window.document.querySelector('div#resp')
            var n1 = Number(ns1.value)
            var n2 = Number(ns2.value)
            function adc(){
                var soma = n1 + n2
                res.innerHTML = soma
            }
            function sub(){
                var sub = n1 - n2
                res.innerHTML = sub
            }
            function mult(){
                var mult = n1 * n2
                res.innerHT = mult
            }
            function dv(){
                var divz = n1 / n2
                res.innerHTML = divz
            }
        </script>
    </body>
    </html>

    382217036_Capturadetela2022-02-03140947.thumb.png.2e5f0da72b9d439877262307a540d9e2.png

    hello, can someone help me this code was to do math operations but the first 3 buttons return 0 and the last NaN, can someone tell me where is the error?

  2. Olá, gostaria de saber se pretende implementar em outro idioma? especificamente português, gosto muito de w3escolas mas sou brasileiro e meu inglês é um pouco ruim o que torna difícil assistir a vídeos

  3. 2 hours ago, Ingolme said:

    Tudo que você precisa fazer é adicionar uma borda a um bloco embutido. Qualquer elemento serve. Se eles ligarem para qualquer lugar, um elemento <a> funcionará.

    
    
      

    Para o bloco preenchido, você pode atribuir a ele uma cor de fundo e alterar a cor para preto.

    thank you very much, now i managed to do

  4. 22 minutes ago, niche said:

    Primeiro passo. Vamos concordar com o que estamos olhando.

    Vejo botões flutuando dentro de uma div, com algum preenchimento e um fundo marrom. O que você vê?

    It's not a button, it's more like a tag, what I'd like to do is this effect of a frame with the text inside (it doesn't have a brown color, it's actually a transparent one)

×
×
  • Create New...