Suma De Dos Valores
<html>
<head>
<body>
<form>
VALOR 1 <input type='text' id='valor1' name='valor1'>
VALOR 2 <input type='text' id='valor2' name='valor2'>
<input type='submit' name='enviar1' value='Enviar' OnClick='prueba()'>
<div id='contenerdor1'>
</div>
</form>
</body>
</head>
</html>
<script type='text/javascript'>
function cargar()
{
var strhtml="";
for (i=1;i<=10;i++)
{
srthtml=strhtml+"<input type= 'text' id='valor0'"+i+"'><br>";
}
document.getElementById('contenedor1').innerHTML=strhtml;
}
function prueba()
{
var z;
var x=document.getElementById('valor1').value;
var y=document.getElementById('valor2').value;
z=parseInt(x)+parseInt(y);
alert(z);
}
</script>
<head>
<body>
<form>
VALOR 1 <input type='text' id='valor1' name='valor1'>
VALOR 2 <input type='text' id='valor2' name='valor2'>
<input type='submit' name='enviar1' value='Enviar' OnClick='prueba()'>
<div id='contenerdor1'>
</div>
</form>
</body>
</head>
</html>
<script type='text/javascript'>
function cargar()
{
var strhtml="";
for (i=1;i<=10;i++)
{
srthtml=strhtml+"<input type= 'text' id='valor0'"+i+"'><br>";
}
document.getElementById('contenedor1').innerHTML=strhtml;
}
function prueba()
{
var z;
var x=document.getElementById('valor1').value;
var y=document.getElementById('valor2').value;
z=parseInt(x)+parseInt(y);
alert(z);
}
</script>
0 Response to Suma De Dos Valores
Publicar un comentario