after addClass to <button> an function doesnt work

after addClass to <button> an function doesnt work

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" href="css/basic.css"/>
  5. <script type="text/javascript" src="js/jquery-2.0.2.js"></script>
  6. <script type="text/javascript" src="js/basic.js"></script>
  7. </head>
  8. <body>
  9. <div id="start">
  10. <button class="create">
  11.             New Form
  12. </button>
  13. </div>
  14. <div id="main">
  15. </div>
  16. </body>
  17. </html>

  18. This is my HTML and this here my JS:

  19. $(document).ready(function() {
  20. var linecountername = 0;
  21. $('.create').on('click' , function(e) {
  22. $(this).hide();
  23. linecountername = linecountername + 1;
  24. $('#main').append('<div class="' + linecountername +'"></div>');
  25. $('.' + linecountername).css({
  26. "border" : "1px solid black",
  27. "font-size": "5em",
  28. });
  29. $('.' + linecountername).append('<a>&equiv;</a><input type="text" placeholder="labelname" required/><button>+</button>')
  30. $('.' + linecountername + ' button').addClass('create');
  31. })
  32. });
  33. after clicking on created button the function doesnt work anymore.
  34. I don' t know how to explain my problem. Hope you understand what I mean.