<table class="container">
<tr>
<td><input type="text" class="foo"></td>
</tr>
<tr>
<td><input type="text" class="foo"></td>
</tr>
<tr>
<td><input type="text" class="foo"></td>
</tr>
</table>
<script>
$(".container tr").click(function(){
alert($(this).find("foo").val());
});
</script>
What it’s supposed to do:
When I click on a table row it will find the input inside this element and alert it’s value.
Thank You!
You miss the
.inside your class selector:FIDDLE: http://jsfiddle.net/wUgt5/