How do I only select the first level of children of an element when using .delegate()?
Say, I have the following HTML:
<div id="list">
<div>Item 1<div>Item 1-1</div></div>
<div>Item 2</div>
<div>Item 3</div>
</div>
When I do $('#list').delegate('div', 'click', function(e) {}), the element <div>Item 1-1</div> would be included (right?) in the handler. How do I only select the first-level child elements for #list with this method then?
You can do the following to only select direct children: