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

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -