jquery - li click event not working -


hi creating search box using li , input text.

i want load page based on selected results of search box, whenever search result clicked.

search result in form of li on binding below click event.

somehow following click event not firing

$("li").click(function(){     alert("hi");     alert($(this).text());     return false; }); 

see js fiddle more details:

http://jsfiddle.net/amitsant/2zhk209v/3/

just listen mousedown instead of click. happens because click waits mouseup event, never triggered because blur comes first, hiding panel.

$("li").mousedown(function(){ ... 

working fiddle: http://jsfiddle.net/3umj3fup/


Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

ruby - How do I merge two hashes into a hash of arrays? -