If you are using IE, then it won't currently work in jQuery 1.2.6.
Add the following fix at the top of your script:

if ($.browser.msie && !$.props.tabindex) $.props.tabindex =
'tabIndex';

and you don't need to use the each() call, just do this:

$(':input').attr('tabindex', -1);

a better idea, is to exclude any inputs that already have a tabindex
attr:

$(':input:not([tabindex])').attr('tabindex', -1);

Hope this helps
- Mark

On Nov 25, 1:04 pm, gil_yoktan <[EMAIL PROTECTED]> wrote:
> Hello I finally managed to make jquery work for me. I want to set all
> "input" tabindex to -1 (not selectable by tab key). This is what I
> wrote (taken from the source of an example)
>
> <script type="text/javascript">
>
>     $(document).ready(function() {
>         // set tabs
>         $(':input').each(function(i, e) {
>             alert("<" + this.id + ">"+ "  TABINDEX= <" + $(this).attr
> ('tabindex') + ">"  );
>             $(this).attr('tabindex', -1);
>             alert("TABINDEX AFTER   = <" + $(this).attr('tabindex') +
> ">");
>         })
>     });
> </script>
>
> The 1st alert shows me the name of the element and the tabindex
> current value
> The 2nd alert - shows me "TABINDEX AFTER = <-1>" as I expected and I
> as need. But the source of the HTML page is NOT changed - none of the
> input tags has a tabindex of -1 !!
> I guess I miss something basic... Please give me a hint to redirect me
> to the right direction.
> Thank you in advance   Gil Yoktan

Reply via email to