0

when my php page loads some jQuery should set focus to my input textbox but it does not

I have tried css selectors like input[tabindex=1] and #31 but to no avail...

here is the jQuery (version 1.7.1)

$(function() {
$('input[tabindex=1]').focus(); // also tried   $('#31').focus(); 
});

and here is the HTML

<input tabindex='1' type='text' class='tablefilter' id='31' style='width:80px;border:inset 2px grey;background-color:white;font-size:12px;border-radius:0px;-moz-border-radius:0px;-webkit-border-radius:0px;'/>

any clues as to why this isn't working?

ScottC
  • 452
  • 8
  • 25

1 Answers1

0

check this out, i just tried your code, it works. which version of jquery are you using? which browser are you using, try open console to see, if there is an exception.

here is the demo: DEMO

Jaiwo99
  • 9,687
  • 3
  • 36
  • 53
  • jquery-1.7.1.js ie9 thats neat but since my code is exactly the same it doesn't help a lot, but its somewhat comforting to know it works for you :) – ScottC Jul 05 '12 at 15:52