Add "<li>" into "<ul>" using jquery - Javascript jQuery

Javascript examples for jQuery:Select Dropdown

Description

Add "<li>" into "<ul>" using jquery

Demo Code

ResultView the demo in separate window


<html>
   <head></head>
   <body> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
      <div id="mycontainer">
         My Div//from  w ww.  j  a va  2  s  .c  o m
      </div> 
      <script>
  var myhtml = "<div><ul></ul></div>";
  var msg = "<li>some message</li>";
 $(mycontainer).append($(myhtml).find("ul").append(msg))

      </script>  
   </body>
</html>

Related Tutorials