Q:

How to add "" into "" using jquery?

Can someone help adding to 'li' into 'ul'. not sure what im missing here. I have html in a variable
Below is the code snippet

var myhtml = "<div><ul></ul></div>";
var msg = "<li>some message</li>";
$(myhtml).find("ul").append(msg);
$("#mycontainer").append(myhtml);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id=mycontainer>My Div</div>

A:

You almost had it, but you forgot to append your list to the div. Just try doing it like this:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id=mycontainer>My Div</div>

<script>
  var myhtml = "<div><ul></ul></div>";
  var msg = "<li>some message</li>";

  $(mycontainer).append($(myhtml).find("ul").append(msg))
</script>

Here's a JSBin with a working version.

