How to set focus to a textbox on page load event

Posted by Kalpana on Stack Overflow See other posts from Stack Overflow or by Kalpana
Published on 2010-04-27T11:44:34Z Indexed on 2010/04/27 11:53 UTC
Read the original article Hit count: 844

Filed under:
|
|
|

I am trying to set focus to the text box on page load event. I tried many solutions by referring the element id, but couldn't able to focus the element. Later when I inspect the element using firebug I found for the same element the id changes in different execution. I am looking for the simplest solution using javascript or jquery to achieve this

    <h:form id="form"> 
      <rich:dataTable value="#{books}" var="book">
        <ui:repeat value="#{authors}" var="author"> 
          <h:inputText value="#{author.name}"/>
        </ui:repeat>
      </rich:dataTable>
</h:form>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery