
Elemento mas grande
Publicado por javascript (24 intervenciones) el 28/03/2015 16:04:35
Error fila 16. ¿Alguno sabe por qué? Gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<head>
<title>mas grande</title>
<script>
function calcul() {
var res = document.getElementById("resultat");
var mp = parseInt(document.getElementById('inf').value);
var mg = parseInt(document.getElementById('-inf').value);
var n = parseInt(document.getElementById('text').value);
while (n != 0){
if (n > mg)
if (n < mp)
(mp = n)
}
res.innerHTML = "str(mp)+" "+str(mg)"
</script>
</head>
<body>
<h3>elemento mas grande:</h3>
<form action="">
<label>numero: </label>
<input type="text" id="numero" placeholder="1"><br>
<button type="button" onclick="calcul()">calcular</button>
</form>
<p id="resultat"></p>
</body>
</html>
Valora esta pregunta


0