Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ydn-javascript] Re: Giving focus to a non-Form element

Expand Messages
  • Adam Moore
    ... Give the element a tabindex attribute: -1 means that it will not get focus when tabbing through the fields, but it can receive
    Message 1 of 4 , May 31, 2007
      On Thu, May 31, 2007 at 12:41:42AM -0000, frankieshakes wrote:
      > Hey Dav,
      >
      > Hehehe... Sorry, forgot the A tag... ;)
      >
      > What I meant was giving focus to elements that don't have a focus()
      > method by default (ie: DIVs, SPANs, etc.).

      Give the element a tabindex attribute:

      <div tabindex="-1"></div>

      "-1" means that it will not get focus when tabbing through the fields, but
      it can receive focus via the focus() method. This does not work in Safari
      (yet): http://bugs.webkit.org/show_bug.cgi?id=7138

      -Adam
    Your message has been successfully submitted and would be delivered to recipients shortly.