Derivan
-
Posts
7 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Derivan
-
-
<!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>
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?
-
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
-
Hello, I'm looking for a good website hosting, which can support many simultaneous users, not too slow for users from other countries. suggestions?
-
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
-
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)
-
JavaScript error math operations
in JavaScript
Posted
Thank you very much I changed the code by placing the number variables inside the functions the code was a little big but it works, Thank you