<script>
function suma ()
{
var num1=nume1(document.getElementById('num1').value);
var num2=nume2(document.getElementById('num2').value);
var resul=nume1+nume2;
document.getElementById('resul').value;
}
</script>
<!-- HOJA DE ESTILO CSS -->
<style class="color">
* {
margin-left: 10%;
margin-right: 10%;
}
.cuerpo {
background: #b3b6b7;
font-family: poiret one;
}
.encabezado {
background: #f0f3f4;
height: 75px;
z-index: 1;
}
.encabezado h1 {
text-align: center;
padding-top: 25px;
text-decoration: none;
}
.grow:hover {
-webkit-transform: scale(1.5);
-ms-transform: scale(1.5);
transform: scale(1.5);
}
.calculadora {
background: #f0f3f4;
margin-top: 30px;
padding-top: 20px;
padding-bottom: 20px;
font-family: poret one;
}
.calculadora .calcu .datos{
padding-top: 10px;
padding-bottom: 20px;
}
.calculadora .calcu .select {
padding-bottom: 20px;
}
textarea {
resize: none;
}
</style>
<!-- HOJA DE ESTILO CSS -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Calculadora</title>
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Poiret+One" rel="stylesheet">
</head>
<body class="cuerpo">
<div class="encabezado">
<h1>Juan Daniel Lovato Gamez 25-3614-2014</h1>
</div>
<div class="calculadora">
<form class="calcu" action="">
<fieldset class="datos">
<legend>Ingrese los valores</legend>
<p>Ingrese el primer numero</p>
<input type="text" name="primerN" maxlength="3" size="20" id="num1">
<p>Ingrese el segundo numero</p>
<input type="text" name="segundoN" maxlength="3" size="20" id="num2">
</fieldset>
<fieldset class="select">
<legend>Seleccione la operacion</legend>
<p>Seleccione la operacion a realizar</p>
<select name="opciones" id="select">
<option value="1"> </option>
<option value="2" id="2" onclick="suma()">suma</option>
<option value="3" id="3" onclick="resta()">resta</option>
<option value="4" id="4" onclick="">multiplicar</option>
<option value="5" id="5" onclick="">dividir</option>
<option value="6" id="6" onclick="">modulo</option>
<option value="7" id="7" onclick="">promedio</option>
<option value="8" id="8" onclick="">maximo</option>
<option value="9" id="9" onclick="">minimo</option>
</select><br><br>
<input class="grow" type="submit" value="Realizar operacion" onclick="">
<input class="grow" type="reset" value="Borra todo">
</fieldset>
<fieldset class="resultados">
<legend>Resultados</legend>
<textarea name="resultados" id="resul" cols="60" rows="1"></textarea>
</fieldset>
</form>
</div>
</body>
</html>
I have this calculator that I have to perform as a task but I'm new to js and I do not know how to call the result to the textarea or if I'm doing something wrong in the script, everything is in a single document xq so I demand the teacher, deante hand thanks for those who wish to help me with this question