Firing an event in java script when ENTER key is pressed….

Posted: March 9, 2011 in Uncategorized

<input name=”tag” type=”text” id=”tag” size=”50″ onkeydown=”checkEnter(event)” onkeypress=”(event)” />

Now, write this function in java script;

function checkEnter(event)
{
var Key = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
if(Key==13){
ev_load_div();
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s