Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140220

how to append a lot of html code with javascript

$
0
0

I want to add an li with some divs and paragraphs to my ul every time I run a certain function in javascript so I have this code in html:

<body>
  <ul id="ul">
   <li class="li">
    <div>
     <p>1</p>
     <p>2</p>
    </div>
   </li>
  </ul>
 </body>

And I wanna add this code to the end of the unordered list:

<li>
  <div class="li">
   <p>3</p>
   <p>4</p>
  </div>
 </li>

I want a function in javascript that can do that in an easy way


Viewing all articles
Browse latest Browse all 140220


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>