[jQuery] Re: how to catch the value of div container

2009-06-14 Thread Antonio

Hi all,

I try to rephrase...
I want to get the value from the id attribute from a parent element
I try in this way...

$('div').parent().attr(id)

but it returns only blank value although the html code is:  div
id=DIV_01

any ideas?

thanks

Antonio


On Jun 14, 1:35 pm, Antonio antonio.pie...@gmail.com wrote:
 Hi All,

 In HTML code:
 div id=DIV_01
 ul
         lia href=#list_01/a
                 ul
                         lia href=#LIST_01_00/a/li
                         .
                 /ul
         /li
 /ul
 /div

 When I click in list element (ese. LIST_01_00)
 In jQuery code, I would like to catch the “id value” (DIV_01) of div
 container.
 $(this).click( function() {
         ?

 }

 Any ideas?

 Thanks,

 Antonio


[jQuery] Re: how to catch the value of div container

2009-06-14 Thread Paul Mills

Hi,
Try this:
$(this).parents('div').attr('id')

Paul

On Jun 14, 2:47 pm, Antonio antonio.pie...@gmail.com wrote:
 Hi all,

 I try to rephrase...
 I want to get the value from the id attribute from a parent element
 I try in this way...

 $('div').parent().attr(id)

 but it returns only blank value although the html code is:  div
 id=DIV_01

 any ideas?

 thanks

 Antonio

 On Jun 14, 1:35 pm, Antonio antonio.pie...@gmail.com wrote:

  Hi All,

  In HTML code:
  div id=DIV_01
  ul
          lia href=#list_01/a
                  ul
                          lia href=#LIST_01_00/a/li
                          .
                  /ul
          /li
  /ul
  /div

  When I click in list element (ese. LIST_01_00)
  In jQuery code, I would like to catch the “id value” (DIV_01) of div
  container.
  $(this).click( function() {
          ?

  }

  Any ideas?

  Thanks,

  Antonio