Simply I have this HTML document
<input type="text" id="my_txt" onkeypress="move_focus(event)"/>
<br>
<input type="button" id="my_btn" />
<script >
function move_focus(e)
{
if (e.keyCode==13) $("#my_btn").focus();
}
</script>
What I want is:
on key press event of input-text my_txt
, if the pressed key is ENTER
key move the focus to my_btn
button.
I did it like above BUT that doesn't work and no any action is done when Enter key pressed.
I found more than one post in this network about this topic but most answers are complex and some me away of what I need.
Help Please!.. Thanks in advance.