miércoles, 17 de agosto de 2016

83. Ejercicios de tablas getElemetById
<script>
document.write('<table width="100%" border="1">');
for(i = 1; i <= 3; i++){
document.write('<tr>');
for(j=1; j <=3; j++){
document.write('<td>');
document.write('<input type="text" id="' + (i+"_"+j) + '" value="">' );
document.write('</td>');
}
document.write('</tr>');
}
document.write('</table>');


function buscar(){
fila = document.getElementById("fila").value;
columna = document.getElementById("columna").value;
texto = document.getElementById("texto").value;

document.getElementById(fila + "_" + columna).value = texto;


}
</script>
<body>
<br><br>Visualizaci&oacute;n de Tablas de 3 x 3.<br><br>Fila: <select name="fila" id="fila" >
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select><br>
columna: <select name="columna" id="columna" >
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<br>
texto: <input type="text" id ="texto"><br>
<input type="button" value="Aceptar" onClick="buscar()">
</body>

No hay comentarios:

Publicar un comentario