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.min.js"></script>
  <style>
    li { list-style-type: none }
    .add-file { cursor: pointer }
  </style>
</head>
<body>
  <ul>
    <li> file 1</li>
    <li> <div class="add-file">+</div>
  </ul>
  <script>
    $('.add-file').click(function (e) {
      e.preventDefault();
      $('.add-file').html('<form action=""><input type="text" name="filename"><input type="submit" style="display:none"></form>');
      $('.add-file').removeClass('add-file');
      $("form").submit(function (event) {
        alert($("input:first").val())
      })
    })
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers