Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <input type="text" id="new-email" />
  <input type="button" id="append" value="Append" />
  <div id="additional-info-list">
  </div>
</body>
</html>
 
$(function(){
  
  
  $('#append').on('click', function () {
    var text = $('#new-email').val();
    var li = '<li>' + text +  '<input type="hidden" name="additionalInfo" value="'+text+'"/><a href="#" class="remove-btn" >remove</a></li>';
    $('#additional-info-list').append(li);
    $('#new-email').val('');
});
  
  $(document).on('click', 'li>.remove-btn', function (event){
    var _this =$(this);
    _this.closest('li').remove();
});
  
  
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers