title: How can I add the 'required' attribute to input on change of textarea?
body: <p>I need to add the required attribute to an html select (toDept) under the condition that a textarea (orderComments) has text typed in it. Below is my code... What am I missing? Do I need to run my jquery on a change event or something?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    $(document).ready(function() {
            if ($('#textareaId').val() != '') {
              $("#selectId").attr('required', true);
            }
          }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;textarea id="textareaId"&gt;&lt;/textarea&gt;
  
  &lt;select id="selectId"&gt;
    &lt;option value=""&gt;&lt;/option&gt;
    &lt;option value="opt1"&gt;opt1&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks for your time!</p>