3
I am developing an instant search system with jQuery, Ajax and PHP. I created a navigation system by the arrow keys of the keyboard in the options resulting from the search. It is working smoothly. But what I want to do is that when enter is keyboard on one of these search options, a click is triggered in the selected option. The problem is that these options are loaded after page loading. So I can’t set a click the traditional way with .click()
, in that element.
I tried to use the
$(elementoPai).on('click', 'elementoFilho', function(){
});
But this only assigns a callback to when the 'elementoFilho'
is clicked. And that’s not what I want.
What I want is to set! Click! on this 'elementFile' by typing the enter.
Can someone help me ?
Thank you in advance.
You can post the code that makes the Ajax request?
– Laerte
I didn’t get it right. Have an example of HTML? when you click enter you want to fire a click on an element.
– Sergio