Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i, temp,
- frag = document.createDocumentFragment(),
- li = document.createElement('li');
- for ( i=0; i<3; i++ )
- {
- temp = li.cloneNode( true );
- temp.appendChild(
- document.createTextNode(
- 'This is new list item number ' + ( i + 1 )
- )
- );
- frag.appendChild( temp );
- }
- document.getElementById('the-list').appendChild( frag );
Add Comment
Please, Sign In to add comment