[jQuery] tabindex for beginners

[jQuery] tabindex for beginners


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