title: Focus dropdown in JSP
body: <p>Hi I am kinda new to <code>JSP/Jquery/Javascript</code>. I'm studying struts right now. In my jsp file, I need to focus on a <code>drop-down list</code> onload of my page / everytime my page loads, I have done it this way:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $(document).ready(function(){
          $("#fault").focus();
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>then in my <code>body</code>, im using the <code>html</code> tag:</p>
  
  <pre><code>    &lt;body onload="makeDisableEnable()"&gt;
  
      &lt;s:form&gt;
      &lt;div class="list"&gt;
          &lt;table&gt;
              &lt;colgroup&gt;
                  &lt;col style="width: 120px;"&gt;
                  &lt;col style="width: 200px;"&gt;
                  &lt;col style="width: 120px;"&gt;
                  &lt;col&gt;
                  &lt;col style="width: 120px;"&gt;
                  &lt;col&gt;
              &lt;/colgroup&gt;
              &lt;tbody&gt;&lt;tr&gt;
              &lt;th&gt;DROPDOWN ONE&lt;span class="font0"&gt;（※）&lt;/span&gt;&lt;/th&gt;
                      &lt;td&gt;&lt;html:select property="failCnd" styleId="fault"&gt;
                      &lt;html:option value=""&gt;&lt;/html:option&gt;
                      &lt;c:forEach var="failCnd" items="${failCndList}"&gt;
                      &lt;html:option value="${failCnd.wideUseCd}"&gt;${f:h(failCnd.wideUseValueView)}&lt;/html:option&gt;
                      &lt;/c:forEach&gt;
                      &lt;/html:select&gt;
                  &lt;/td&gt;
  </code></pre>
  
  <p>This is what I have done but its not working. Could anyone tell me what I have done wrong? Or what are other ways. Thank you very much for the help.</p>