tags:

views:

26

answers:

1

how can i change focus into particular div after any event via jquery?

+1  A: 

To make a div focusable, it needs to have a 'tabindex' attribute.

<div id='test' tabindex='1'></div>

Then, you can focus with e.g.

$('#something').click(function() {
  $('#test').focus();
});
sje397
It is fine with IE and Chrome.It is not working in Firefox.What can i do?
Loganphp
[This data](http://nemisj.com/focusable/) seems to indicate it should work in FF. Are you sure it's just not a display issue?
sje397
@Loganphp - I tested Firefox 3.6.8 using [this example](http://jsfiddle.net/SNXk2/) and it worked fine.
sje397
ya fine.Your example is working me also but i don't know why mine is not working
Loganphp