Focusing To A Div Aftering Rendering

Hello, Can any body tell me how can i focus to a div after rendering?

Now i am using like this.

$this->render(‘index’,array(‘div’=>‘div2’));

and i used javascript to focus to the "div2" on the view file "index".

Is there any other option?

No, you’ll need to use javascript.

For non-IE support, you could look at this HTML 5 attribute:

http://www.w3schools.com/html5/att_input_autofocus.asp