BARON'S
BARON'S

Reputation: 133

key arrow navigation on ul li not on input form

I would like to add arrow key navigation for ul li item on my page using jquery, however on the same page there is a form with input text. Problem is the input text also catch the key arrow event. How to go about so only the ul li container catch these event, not others. Thanks in advance.

Upvotes: 0

Views: 470

Answers (2)

Joseph Marikle
Joseph Marikle

Reputation: 78550

$("#myForm input:text").on("keyDown", function(event){
    event.stopPropagation();
});

That should might fix it.

Upvotes: 1

Ken
Ken

Reputation: 548

Should be solvable with more discrete class names and or selectors. As ul/li are not input elements, I'm not really sure where/why the problem is happening.

Please use the built in code display manager, or jsfiddle when you want help w/ code.

Upvotes: 0

Related Questions