title: javascript - how would you write the if(...) statement for selection options in a form?
body: <p>How do you write the <code>if</code> statement for a select option using javascript?</p>
  
  <p>I wrote a form and made a select option list. I want to write an <code>if</code> statement that will do something if an option is selected.</p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>function name(obj) {
      if (option.value == "cat") {
          document.getElementById("owner").jim.disabled = true;
      }
  }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;p&gt;
      selection:*
      &lt;select id="Sone" name="Selection" size="1"&gt;
          &lt;option&gt;Select&lt;/option&gt;
          &lt;option value="cat" onclick="name(this);"&gt;cat&lt;/option&gt;
          &lt;option value="dog" onclick="name(this);"&gt;dog&lt;/option&gt;
          &lt;option value="bird" onclick="name(this);"&gt;bird&lt;/option&gt;
          &lt;option value="Other" onclick="name(this);"&gt;Other&lt;/option&gt;
      &lt;/select&gt;
  &lt;/p&gt;
  </code></pre>