JavaScript:
  1. //Create new list element
  2. var new_item         = document.createElement('li');
  3. var new_item_label = document.createTextNode(title);
  4. new_item.appendChild(new_item_label);
  5. new_item.id = '467894sfs6f579f4sa6';
  6.  
  7. parent_container.appendChild(new_item);

Share
Share →

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>