How to use JQuery to focus on a specific DIV tag?

Posted by kwokwai on Stack Overflow See other posts from Stack Overflow or by kwokwai
Published on 2010-05-17T06:33:25Z Indexed on 2010/05/17 6:40 UTC
Read the original article Hit count: 290

Filed under:

Hi all,

Say I got a few DIV tags in a HTML page like:

<DIV ID="div1">              
<Input type="radio" name="data['site1']['user']" VALUE="1">user1<br/>
</DIV>
<DIV ID="div2">              
<Input type="radio" name="data['site1']['user']" VALUE="2">user2<br/>
</DIV>
<DIV ID="div3">              
<Input type="radio" name="data['site1']['user']" VALUE="3">user3<br/>
</DIV>
<DIV ID="div4">              
<Input type="radio" name="data['site1']['user']" VALUE="4">user4<br/>
</DIV>

Is it possible to do the same effect in JQuery like this:

Document.getElementByID('div2').focus();

© Stack Overflow or respective owner

Related posts about jQuery