jquery .click function not getting triggered
- by aakashbhowmick
I have the following HTML and Javascript code. I am trying to make a search suggestion system. The list-items in the unordered-list 'search_suggest' are retrieved dynamically using ajax as the user types in the input box 'site_search' and inserted.
<form name="search_site_form" method="get" action="search.php">
<input id="site_search" name="q" class="search_input input" autocomplete="off" value="Search the site" type="text"/>
<ul id="search_suggest">
</ul>
<input value=" " type="submit" class="search_submit"/>
<script type="text/javascript">
<!--
$("ul#search_suggest>li").click(function(){
alert('123');
});
//-->
</script>
</form>
Clicking on the list items in search_suggest however is not triggering the click function. Any idea why?