Función para detectar la tecla ENTER (Javascript)

Enviado por alegg | En Codigo | El 23-08-2009

1


function DetectoEnter(e)
{
	var key;
	var keychar;

	if(window.event || !e.which) // IE
	{
		key = e.keyCode; // para IE
	}
	else if(e) // netscape
	{
		key = e.which;
	}
	else
	{
		return true;
	}

	if (key==13) //Enter
	{
	  // codigo aqui
	}
}
Comparte!:
  • Print
  • Facebook
  • Mixx
  • Google Bookmarks
  • BarraPunto
  • Bitacoras.com
  • Blogosphere News
  • email
  • LinkedIn
  • Meneame
  • PDF
  • Technorati

Comments (1)

Información Bitacoras.com…

Valora en Bitacoras.com: function DetectoEnter(e) { var key; var keychar; if(window.event || !e.which) // IE { key = e.keyCode; // para IE } else if(e) // netscape { key = e.which; } else { return true; } if (key==13) //Enter { // codigo aqui } }…

Write a comment