jQuery live preventDefault failing on input elements
I have the following snippet of code: $('#messages input').live('keydown', function(e){ if(e.keyCode == 13) { alert($(this).attr('value')); e.preventDefault(); return false; } }); where "#message input" is obviously a group of input text elements. I want to catch the "enter" key and prevent it from refreshing the page....