Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/05/2012, 00:09
george180
 
Fecha de Ingreso: junio-2008
Mensajes: 22
Antigüedad: 15 años, 11 meses
Puntos: 0
Pregunta ejecutar boton desde javascript externo

buenas noches, necesito ejecutar un boton pero desde un archivo javascritp externo por ejemplo:

este es mi .js

function muestraMensaje()
{
alert ('REGLAS DE LA PEÑA');
}

document.getElementById("prueba").onclick=muestraM ensaje;


Y este es mi archivo .html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html40/strict.dtd">

<html>
<head>
<script type="text/javascript" src="lfm.js"></script>
<title>NOTARY LEAGUE</title>
</head>

<body>

<input id="prueba" type="button" value="pinchame">
</body>
</html>

Muchas gracia por su ayuda.