Wrap all created li-elments after click

Posted by user317919 on Stack Overflow See other posts from Stack Overflow or by user317919
Published on 2010-04-15T20:07:08Z Indexed on 2010/04/15 20:13 UTC
Read the original article Hit count: 379

Filed under:
|
|
|
|
 $('input[name="iplus"]').click(function() {  

    $("#billsumary").append("<li>Test</li>");

}); 

Hi,

i append a li-elemnt on every click. Now I like to wrap all those created li-elements into an ol-element but not each created one but all of them together.

sample html output:

<div id='billsumary'>
<ol>
 <li>Test</li>
 <li>Test</li>
 <li>Test</li>
  ...
 <li>Test</li>
</ol>
</div>

© Stack Overflow or respective owner

Related posts about li

Related posts about wrap