Appending HTML Content with Attributes to a jQuery Selector
<p>I want to add DIV tags with attributes within a selected element. I understand that the normal way of inserting HTML content according to the <a href="http://api.jquery.com/append/" rel="nofollow">jQuery website</a> is to:</p>

<pre><code>$('#selected_element').append('&lt;DIV id=' + A + '&gt;{HTML CONTENT}&lt;/DIV&gt;');
</code></pre>

<p>However, I also need to add mouse events on the DIV tags at the same time. I note that there is a way that looks like this:</p>

<pre><code>$('#selected_element').append($('&lt;DIV&gt;', {
 mouseover: function(){alert('mouseover');},
 mouseout: function(){alert('mouseout');}
}));
</code></pre>

<p><strong>How do I combine the two methods to add both content and attributes?</strong></p>
