I need to open the child class / div when click on link:
I have:
echo '<td><a class="openhiddenmessage" href="#">'.$title.'</a></td>'; //If user clicks here
echo '<div class="hiddenmessage" style="display:none">'.$message.'</div>'; //This shows up
The problem is that theres many so I need to know which belongs to each.
Here is the JQuery:
$('.openhiddenmessage').click(function(){
$('.hiddenmessage').show();
});
How can I get it to open ot's child?
UPDATE: For some reason none of the answers given is working so here's the whole part:
echo '<tr>';
echo '<td><a class="openhiddenmessage" href="#">'.$title.'</a></td>';
echo '<td>'.$date.'</td>';
echo '<td><a id="deletemessage" href="delete.php?id='.$id.'" class="delete">Delete</a></td>';
echo '<div class="hiddenmessage" style="display:none">'.$message.'</div>';
echo '</tr>';