I have a php array:
$users = array('Bob' => 'User',"Tom Smith'=>'Owner','Jack Mason' =>'User');
I am creating a table of these users:
<table align='center' width='100%' name='summary' id='summary'>
foreach ($users as $key => $value)
{
echo "<tr><a href='#' id='" . $key . "' class='getDetail'>
<th>" . $key . "</th>
.....etc
}
and jquery
$('#summary tr').click(function() {
alert($(this).attr('id'));
});
i would expect the alert to show the key of the array. The $key is definitely set because i see it in the "th" field.
when i click on any row in table i get "undefined" in my alert window. I am smacking my head against the wall as to why.....