title: Problems with Countdown in JQuery
body: <p>When I double click the card the dialog pops up, and it is then possible to create comments. So far so good. When creating the comments it is possible to edit it.</p>
  
  <p>Then I want to have a countdown for the "edit" eg. after 3 sec the "edit" might be invisible for the user. So far so good. </p>
  
  <p>The issue is, after closing the window or saving the data via button and opening the same card the edit appears again for 3 sec and so on. </p>
  
  <p>I want when creating the comments, and after 3 sec the "edit" never appears again. Just like on this site. </p>
  
  <p>Any idea how to implement this? </p>
  
  <p><a href="http://jsfiddle.net/fyLS9/" rel="nofollow">Live Demo</a></p>
  
  <p>jQuery: Countdown,</p>
  
  <pre><code>// Set the timer to countdown 
          var sec = 3;
          var timer = window.setInterval(function () {
              sec--;
              if (sec == -1) {
                  $('.edit').addClass('hidden');
                  clearInterval(timer);
              }
          }, 1000);
  </code></pre>
  
  <p>jQuery: Add comment,</p>
  
  <pre><code>function addComment(commentString) {
  
          var container = $('#divComments');
          var inputs = container.find('label');
          var id = inputs.length + 1;
          var data1 = {            
              commentString: commentString
          };
  
          var div = $('&lt;div /&gt;', { class: 'CommentStyle' });
  
          $('&lt;label /&gt;', {
              id: 'comment' + id,
              for: 'comment' + id,
              text: commentString
          }).on('change', function () {            
              data1.commentString = $(this).text();
          }).appendTo(div);      
  
          $('&lt;br/&gt;').appendTo(div);
  
          var $Image = $('&lt;img /&gt;',
              {
                  "src": "/Pages/Images/alert.png",
                  "class": "CommentImage",
                  "for": "comment" + id
              }).appendTo(container);
  
          var d = new Date();
          var $fulaDate = $('&lt;div&gt;' + d.getDate()
              + "-" + monthNames[d.getMonth()]
              + "-" + d.getFullYear()
              + "//" + d.getHours()
              + ":" + d.getMinutes()
              + '&lt;/div&gt;').addClass('labelStyle').append(' ~').appendTo(div);
  
          var $edit = $('&lt;p /&gt;', {
              class: 'edit',
              for: 'comment' + id,
              text: 'Edit'
          }).append(' ~').appendTo(div);
  
          var $delete = $('&lt;p /&gt;', {
              class: 'delete',
              for: 'comment' + id,
              text: 'Delete'
          }).appendTo(div);
  
         // Set the timer to countdown 
          var sec = 3;
          var timer = window.setInterval(function () {
              sec--;
              if (sec == -1) {
                  $('.edit').addClass('hidden');
                  clearInterval(timer);
              }
          }, 1000);        
          div.appendTo(container).focus();
          container.data('comments').push(data1);
      }
  </code></pre>