Why is it that, whichever of the following I use to create a new <ul>
element, the HTML is empty:
var complaintsList = $('<ul/>', { id : 'myId' });
or
var complaintsList = $("<ul id='myId'></ul>");
alert($(complaintsList).html());
When I add <li>
elements to the list and output the HTML, only the HTML of the <li>
elements is displayed.
Can someone explain what I'm doing wrong please?