Java - Tabla de Multiplicar

 
Vista:

Tabla de Multiplicar

Publicado por Xony (1 intervención) el 16/02/2007 13:11:50
HOla... tengo un problemilla con el siguiente codigo haber si ustedes saben solucionarlo porfa.

xD

<html>
<head>
<title>Tabla de multiplicar</title>

<script type="text/javascript">

document.write('<form name="Formulario">');
document.write('<p>Tabla de Multiplicar <input type=text size=4 value=1 name="numero">');
document.write('<input name="genera" type="button" onClick="generar(this.form)" value="Generar"> </p>');

document.write('</form>');
</script>

<script type="text/javascript">



var i;
var n;

function generar(form) {

i=eval(form.numero.value);
document.write("<table border=1>");
for (n=0; n<=10; n++) {


document.write("<tr>");
document.write('<td height="29" border="1">'+i+' x '+n+' =</td>')
document.write('<td height="29" width="70" border="1">'+(i*n)+'</td>')
document.write("</tr>");
}
document.write("</table>");

}



</script>

</head>
<body>


</body>
</html>


en concreto esta bien, solo quiero que al darle a generar no me desaparezca este boton y me vuelva a salir para otra consulta. Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Tabla de Multiplicar

Publicado por luis (88 intervenciones) el 16/02/2007 18:35:40
pus yo le puse asi a ver si te sirve
<html>
<head>
<title>Tabla de multiplicar</title>

<script type="text/javascript">

document.write('<form name="Formulario">');
document.write('<p>Tabla de Multiplicar <input type=text size=4 value=1

name="numero">');
document.write('<input name="genera" type="button" onClick="generar(this.form)"

value="Generar"> </p>');

document.write('</form>');
</script>

<script type="text/javascript">


var i;
var n;

function generar(form) {
i=eval(form.numero.value);
document.write("<table border=1>");
for (n=0; n<=10; n++) {

document.write("<tr>");
document.write('<td height="29" border="1">'+i+' x '+n+' =</td>')
document.write('<td height="29" width="70" border="1">'+(i*n)+'</td>')
document.write("</tr>");
}


document.write("</table>");
document.write('<form>');
document.write('<INPUT TYPE="button" VALUE="volver a generar"

onClick="history.go(-1)">');
document.write('</form>');
}


</script>

</head>
<body>

</body>
</html>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar