JavaScript - no muestra < >

 
Vista:
sin imagen de perfil

no muestra < >

Publicado por javascript (24 intervenciones) el 02/04/2015 17:20:37
Hola, haber si me pueden ayudar. Estoy buscando como puedo poner en javascript esto res.innerHTML = "Resultat: str(mp) + str(mg)" . es para que muestre el número más pequeño y mas grande de una serie de enteros.<html>
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
<head>
<title>mas grande</title>
<script>
 
function calcul() {
    var res = document.getElementById("resultat");
    var mp = parseFloat(document.getElementById('inf').value);
    var mg = parseFloat(document.getElementById('-inf').value);
	var n = parseInt(document.getElementById('text').value);
      while (n != 0){
			if (n > mg)
			if (n < mp)
            (mp = n)
}
        res.innerHTML = "Resultat: 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>

Les dejo el código para que prueben. Gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
-1
Responder