Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/02/2006, 14:42
Avatar de SiR.CARAJ0DIDA
SiR.CARAJ0DIDA
 
Fecha de Ingreso: junio-2004
Ubicación: Acá
Mensajes: 1.166
Antigüedad: 20 años, 7 meses
Puntos: 4
no hace falta el eval ni pasarle parametro ya que es global..

Código:
<script type="text/javascript">
var i = 0
function hola(){ 
	i++
	elem=document.createElement('input');
	elem.type = "button";
	elem.value = "borrar";
	elem.onclick=fun2;
	document.body.appendChild(elem);
}  
function fun2(){
	alert(i)
}
</script>
</head>
<body>
<a href="#" onclick="hola();return false">hola</a>
</body>
__________________
Internet Explorer SuckS
Download FireFox