Jump to content

Get an element with his class by calling his parent first... jQuery help!


ltrem

Recommended Posts

Hey guys,

 

<td id=”test”>
   <div>blabla</div>
   <div class=”ulError” style=”margin: 0px 0px 0px 0px;”></div>
</td>

 

I want to access to the second div in jQuery... but I also want to access it from the TD #test.

 

I tried different thing like :

 

$(’#test:eq(1)’).......... didn’t worked.

$(’#test > .ulError’)........ didn’t worked.

 

I need to get to the .ulError by the #test because I have a #test2 that is exactly the same... so I can't just call the .ulError straight...

 

Would this work?

$('#test').children('div .ulError')

 

Thanks for your time!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.