Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/01/2010, 03:41
Avatar de JOSANCIN
JOSANCIN
 
Fecha de Ingreso: septiembre-2008
Ubicación: huesca
Mensajes: 298
Antigüedad: 15 años, 8 meses
Puntos: 0
pasar un valor como argumento

Hola a todos
Tengo un formulario con dos botones que llaman a una misma funcion, me gustaria que cuando aprieto a uno de ellos se pase el valor 1 a la funcion getfocus mientras que si aprieto al otro se pase el valor 2 a la funcion get focus
No tengo ni idea como expresarlo, agradeceria si alguien me pudiese dar alguna pista.
que vaya bien y feliz año a todos


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>prueba</title>
<script type="text/javascript">
function getfocus()
{
document.getElementById('1').focus();
}


</script>

</head>
<body>





<a id="1" href="">foco en 1</a>
<br>
<br>;
<a id="2" href="">foco en 2</a>
<br>
<form>
<input type="text" name="dato">
<input type="button" onclick="getfocus()" value="1">
<input type="button" onclick="getfocus()" value="2">
</form>

</body>
</html>