javascript - event propagation in IE -


in simple html page, below code,

<ul>         <li id='testlist' style='border: 1px solid #2e2e2e;width:100px;height:100px;' onkeydown= "alert('kd');" onkeypress="alert('kp');" tabindex='0'>             click me          </li> </ul>    

when press "enter" (with focus on li element), first "kd" pops , "kp" popups. infer onkeydown() executes first followed onkeypress(). means event propagation key down key press happens normally.

but in project, same code,this flow isn't happening. flow stops "kd".

what possible reasons event propagation stopping onkeydown() , not moving onkeypress()

my doubt possible ways achieve scenario. ie. stopping event propagation. 1 possibility got know "stoppropagation". haven't used in code anywhere. there other possibility achieve same.

these events not been propagated. 2 separated events.

keypress 1 event , keydown event.

there no way stop propagating keypress keydown event (without custom code flags or else).

event propagation happens child element parent element. not 1 eventtype eventtype.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -