Input focus with jQuery

Posted on Mon 16 June 2008 in jQuery

Form input focus always seems a pain to me, I don't like all of the generated inline javascript that struts or other frameworks add to accomplish this and it always seems to be one issue or another. So here's a simple solution that applies focus to the last input element in the document that has a class of focus. Short and sweet, nothing fancy, requires the jQuery library of course.

The javascript, preferrably in an external javascript file