Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Setting focus to a textarea after it has been loaded via ajax .load()

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #34192
    lyleyboy
    Member

    Hi all,

    I’m having trouble trying to set the focus to a textarea that resides inside a div which is ajax loaded using .load().

    I understand that I’ll need to use .live() as this div isn’t in the DOM but I just don’t know how to do it.

    Any help would be great thanks.

    #86488
    lyleyboy
    Member

    Anyone out there know how to do this? I’m still stuck.

    Cheers

    #86501
    jamygolden
    Member

    If #foo is the id of the input element:

    $('#foo').focus();
    #86576
    lyleyboy
    Member

    Cheers for that but it doesn’t work as the div was loaded after the DOM.

    #86595
    jamygolden
    Member
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.