View difference between Paste ID: yuL4wyXD and 5fEdGL3i
SHOW: | | - or go back to the newest paste.
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<title></title>
5
<script type="text/javascript"> 
6
	function convertir(){
7
		var accion = document.getElementById("selector");
8-
			document.getElementById("resultado").value =
8+
9-
    Math.round(parseInt(cantidad) / 166.386);
9+
10
			document.getElementById("resultado").value = Math.round(parseInt(cantidad) / 166.386);
11
		}
12-
			document.getElementById("resultado").value =
12+
13-
    Math.round(parseInt(cantidad) * 166.386);
13+
			document.getElementById("resultado").value = Math.round(parseInt(cantidad) * 166.386);
14
		}
15
	}
16
	window.onload=function(){
17
		boton=document.getElementByID("boton");
18
		boton.setAttribute("onClick","convertir()"); 
19
}
20-
<table border=0>
20+
21-
<tr>
21+
<style>
22-
  <td><label for="importe">Importe a convertir</label></td><td><input type="text" name="importe" id="importe" /></td>
22+
	form{max-width:350px;}
23-
</tr>
23+
	p{text-align:center;}
24-
<tr>
24+
	label{
25-
  <td><label for="resultado">Resultado</label></td><td><input type="text" name="resultado" id="resultado" /> </td>
25+
		display:inline-block;
26-
</tr>
26+
  		width:9em;
27-
<tr>
27+
  		text-align:left;}
28-
  <td colspan=2>
28+
	select{width:100%;}
29
</style>
30
</head>
31
<body>
32
<form name="conversor">
33-
  </td>
33+
<p><label for="importe">Importe a convertir: </label><input type="text" name="importe" id="importe" /></p>
34-
</tr>
34+
<p><label for="resultado">Resultado: </label><input type="text" name="resultado" id="resultado" /> </p>
35-
<tr>
35+
<p><label></label>
36-
  <td align="center" colspan=2><input type="button" value="Convertir"
36+
37-
        onClick="convertir()" /></td>
37+
38-
</tr>
38+
39-
</table>
39+
40-
</form>
40+
</p>
41-
41+
<p><input type="button" id="boton" value="Convertir" /></form>
42
</body>
43
</html>