title: Jquery Binding value to textbox based on user input to other textbox
body: <p>I have 2 textboxes:</p>
  
  <pre><code>&lt;table id="table1"&gt;
    &lt;tr id="first_row"&gt;
      &lt;td&gt;&lt;input type="text" id="txt1"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" id="txt2"&gt;&lt;td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>and I have it so that one's text is populated by the content of another:</p>
  
  <pre><code>$('#txt2').keyup(function(){
    var content = $('#txt2').val();
    $('#txt1').val(content);
  });
  </code></pre>
  
  <p>And when #txt2's content is empty, I am trying to get #txt1's content to have the string "empty".</p>
  
  <p>Something like:</p>
  
  <pre><code>if ($('#txt2').val('')) {
    $('#txt1').val('empty');
  }
  </code></pre>
  
  <p>but in real time, as opposed to just on the page load.</p>