I’m appending to below div with id “toadd” using this javascript :
$("#toadd").append("<li><a href=\"acura.html\"></a></li>");
<div id="toadd" data-role="content">
<p>Page 1 content</p>
<ul data-role="listview" data-theme="g">
</ul>
Is it possible to append to ‘ul’ element within the div? something like
$("#toadd.ul").append("<li><a href=\"acura.html\"></a></li>");
Try it without . between #toadd and ul:
Edit:
$("#toadd.ul")means you are looking the element that has id=”toadd” and has a class named “ul”.$("#toadd ul")selects all ul that are enclosed within #toadd element.