title: jquery Allow td doubleclick only when not contains input
body: <p>I´ve following function for table editing:</p>
  
  <pre><code>$(function () {
  $("td").dblclick(function () {
      var OriginalContent = $(this).text();
  
      $(this).addClass("cellEditing");
      $(this).html("&lt;input type="text" value="&amp;quot; + OriginalContent + &amp;quot;" /&gt;");
      $(this).children().first().focus();
  
      $(this).children().first().keypress(function (e) {
          if (e.which == 13) {
              var newContent = $(this).val();
              $(this).parent().text(newContent);
              $(this).parent().removeClass("cellEditing");
          }
      });
  
  $(this).children().first().blur(function(){
      $(this).parent().text(OriginalContent);
      $(this).parent().removeClass("cellEditing");
  });
  });
  });
  </code></pre>
  
  <p>Which works like this: <a href="http://www.ssiddique.info/demo/editable-table-using-jquery" rel="nofollow">http://www.ssiddique.info/demo/editable-table-using-jquery</a></p>
  
  <p>If I doubleclick the td an input is added to the cell, unfortunately the doubleclick is also fired if I double click inside the input which results in an empty input.</p>
  
  <p>How can I prevent the secong double click? Or fire doubleclick only when td not contains an input?</p>
  
  <p>Thanks,</p>
  
  <p>t book</p>