So I have a container div, within it, using .load I load some content from db, after the .load the result will be something like
<div id="results">
<div id="a1" class="search-result"></div>
<div id="a2" class="search-result"></div>
</div>
As I understand it, I should be able to select the nested div's by using $("#results .search-result") but I just cant get it to work. If I try:
$("#results .search-result").click(function() {
alert('click');
}
it just doesnt seem to work. It does work if I use:
$("#results").click(function() {
alert('click');
}
the only thing I can think of is that because the nested div's are loaded using .load then it might not be able to see them?
any help?