Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="form">
- <h4>
- List 1
- </h4>
- <ul id="list">
- <li>Item 1 <input></li>
- </ul>
- <button id="addItem">
- Add Item
- </button>
- </div>
- <button id="addList">
- Add List
- </button>
- </body>
- //add List Item
- itemNumber = 2;
- $("#addItem").click(function(){
- newItem = "<li>Item "+ itemNumber +" <input></li>";
- $('#list').append(newItem);
- itemNumber = itemNumber + 1;
- })
- //add another list
- listNumber = 2;
- $("#addList").click(function(){
- newList = "<h4>List 1</h4> <ul id='list'> <li>Item 1</li> </ul> <button id='addItem'>Add Item</button>";
- $('.form').append(newList);
- listNumber = listNumber + 1;
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement