tabindex for dialogs

tabindex for dialogs

I am using several jquery dialogs on one page (using static divs). Each one generally has one or more input fields, a couple of buttons (defined through the dialog API), and the close 'X' button. I notice that the default tab index differs from browser to browser. FireFox is the only one that correctly uses the order that I want; that is, when the dialog div is opened, it starts with the first input field and follows the order defined on the page, ending with the 'X' close button, then looping around again to the first input field. Chrome and IE however, skip the 'X' close button entirely and go outside the page up to the address bar, and you cannot tab back to the dialog.

So how do I ensure that all browsers behave like FireFox?

Using version 1.8.15.

Thanks!