I am trying to access an id that is nested, but is also duplicated in a number of areas. Something similar to the following sample markup:
<td id='one'>
<p id='up'>up 1</p>
<p id='down'>down 1</p>
</td>
<td id='two'>
<p id='up'>up 2</p>
<p id='down'>down 2</p>
</td>
I tried using
$('#three').click(function(){
$('td#one p#up').hide();
});
but that doesn't work. But this does work:
$('#four').click(function(){
$('p#up').hide();
});
Can someone explain how to hide specifically the p tag with the text 'up 1'?
Fiddle: http://jsfiddle.net/6UBwD/
All help is appreciated
EDIT: Changed id's to classes, and still no dice. What am I doing wrong? FIDDLE: http://jsfiddle.net/6UBwD/4/