javascript - Keypress event doesn't work in internet explorer -


i have follow code:

<input class="any" type="text" id="myid" name="myname" /> 

this input jquery datepicker.. (http://jqueryui.com/datepicker/)

my js follows:

$('#myid').keypress(function(evt) {    //codes }); 

i tried keypress, keydown , keyup.. not working in ie..

may because of jquery date picker plugin?

i tried jquery hotkey plugin (https://github.com/jeresig/jquery.hotkeys/blob/master/jquery.hotkeys.js)

but, no success :(

i want capture enter event..

any help?

felipe

if element doesn't exist on page on initial load, event may not bound button. not sure why works in other browsers though.

could possibly try see if helps

$(document).on('keypress', '#myid', function() {  // .... }); 

if you're using older version of jquery, you'll need use .live().


Comments

Popular posts from this blog

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -

c# - Pausing a storyboard on TabItem mouse over -

c# - Attribute value in root node of xml Linq to XML -