title: I need to change the disabled attribute with JavaScript once the user has chosen an option on the AutoComplete input type text?
body: <p>My question is easy but for me is complicated. The thing is that I need to check if user has chosen an option on an autocomplete input text, and if the input is not blank then I want to activate a button to submit or something like it.</p>
  <p>I have base of the logic, but It doesn't work and I don't know why.
  Please, suggest me something, I am 25 years old and I am getting desesperate because I want to be a good programmer but I am not able to write good programs by myself.</p>
  <p>Here's the code:</p>
  <pre><code>&lt;input type=&quot;text&quot; id=&quot;options-select&quot;&gt;
  </code></pre>
  <p>The JavaScript:</p>
  <pre><code>  $( function() {
      var availableTags = [
        &quot;ActionScript&quot;,
        &quot;AppleScript&quot;,
        &quot;Asp&quot;,
        &quot;BASIC&quot;
      ];
      $( &quot;#options-select&quot; ).autocomplete({
        source: availableTags,
        select: // I don't know what to put in here...
      });
    } );
  </code></pre>
  <p>The HTML button:</p>
  <pre><code>&lt;input type=&quot;submit&quot; class=&quot;btn btn-primary&quot; disabled&gt;
  </code></pre>
  <p>Thank you and blessings.</p>