title: Populate input text box based on drop down select box in Jquery
body: <p>I have a drop down select box and input text box. Select box display my categories and its look like this: </p>
  
  <pre><code>&lt;select id="category" name="category"&gt; 
    &lt;option value=""&gt;Please select...&lt;/option&gt; 
    &lt;option value="1"&gt;Category-1&lt;/option&gt; 
    &lt;option value="2"&gt;Category-2&lt;/option&gt; 
    &lt;option value="3"&gt;Category-3&lt;/option&gt;   
    &lt;option value="4"&gt;Other&lt;/option&gt; 
  &lt;/select&gt;
  </code></pre>
  
  <p>Input text box is like this: </p>
  
  <pre><code>&lt;input type="text" id="otherCategory" name="otherCategory" value="" style="display: none;"&gt;
  </code></pre>
  
  <p>My question is. when an user select only "Other" from dropdown then I need to populate the input text. </p>
  
  <p>I tried it something like this: </p>
  
  <pre><code>$(document).ready(function() {
  
      $('#category').change(function() {
          var myValue = $(this).val();
          var myText = $("#category :selected").text();
  
          if (myText != '' AND myText == "Other") {
             $("#otherCategory").show();
          }
      });
  });
  </code></pre>
  
  <p>But I couldn't get it to work. Can anybody tell how I figure this out. </p>
  
  <p>NOTE: my dropdown select populating dynamically. </p>
  
  <p>Thank you. </p>