Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,005
    Thanks
    58
    Thanked 10 Times in 10 Posts

    Jquery parent div

    Hi im tying to get the parent of the current element and then navigate down to a inner div, but I can't get any lower that the first div even if I do parent('div div')


  • #2
    New to the CF scene
    Join Date
    May 2012
    Location
    Norway :)
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Quote Originally Posted by nikos101 View Post
    Hi im tying to get the parent of the current element and then navigate down to a inner div, but I can't get any lower that the first div even if I do parent('div div')
    You can try $(this).closest('div'); or $(this).parents("div:first");

  • #3
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,005
    Thanks
    58
    Thanked 10 Times in 10 Posts
    No luck

    Div parent
    -------Button calling
    --------Div I keep getting
    --—-----------Inner div I want


  • #4
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,005
    Thanks
    58
    Thanked 10 Times in 10 Posts
    I managed to do it with the chilDren thing. Do you know how I would apply a function to a level 1 button and not to level 2 button (in another div)?



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •