Está en la página 1de 2

<!

DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="estilos.css">
<form action="/action_page.php">
<script>
function funcSuma(){
let numero1= parseInt(document.getElementById("num1").value)
let numero2= parseInt(document.getElementById("num2").value)
let totalsuma = 0;

totalsuma=numero1+numero2;

document.getElementById("suma").innerHTML= "la suma es "+totalsuma;


}
</script>
<script>
function funcresta(){
let numero1= parseInt(document.getElementById("num1").value)
let numero2= parseInt(document.getElementById("num2").value)
let totalresta = 0;

totalresta=numero1-numero2;

document.getElementById("resta").innerHTML="la resta es "+totalresta;


}

</script>
<script>
function funcmulti(){
let numero1= parseInt(document.getElementById("num1").value)
let numero2= parseInt(document.getElementById("num2").value)
let totalmulti = 0;

totalmulti=numero1*numero2;

document.getElementById("multiplicacion").innerHTML=" la multiplicacion es
"+totalmulti;
}

</script>
<script>
function funcdivi(){
let numero1= parseInt(document.getElementById("num1").value)
let numero2= parseInt(document.getElementById("num2").value)
let totaldivi = 0;

totaldivi=numero1/numero2;

document.getElementById("divicion").innerHTML="la divicion es"+totaldivi;


}

</script>

</head>
<body>
<header>
<p>el calculo de las operaciones</p>
</header>
<main>
<div>
<div>
<label>NUM 1</label>
<input tipe="text" id ="num1">
</div>
<div>
<label>NUM 2</label>
<input tipe="text" id="num2">
</div>
<div>
<label id ="suma"></label>
<label id ="resta"></label>
<label id ="multiplicacion"></label>
<label id ="divicion"></label>
<input type="reset" value="Reset">
</div>

</div>

<button type= "button" onclick="funcSuma()">sumar</button>


<button type= "button" onclick="funcresta()">resta</button>
<button type= "button" onclick="funcmulti()">multiplicación</button>
<button type= "button" onclick="funcdivi()">division</button>
</form>
</main>
<footer>

</footer>
</body>
</html>

También podría gustarte