Focus first Form field with jQuery
I somehow like the jQuery JavaScript library. Have a look at the jQuery code for the Zebra-Table-Showdown: Ain’t this a beauty?
However, when it comes to focusing the first (visible) field on a form, things are not that elegant. I got it working, though. Here’s my current attempt:
Use it like this:
I wonder, though, if there is a more comprehensive expression to find the first element of either type “input”, “select”, or “textarea”.
will not work, since it will always return the first “input”, regardless if there is a “select” or “textarea” before it.
Any suggestions?