When you have the current object referrer
this in your code,
Code:
onclick=go_java(this)
you may change your javascript to
Code:
function go_java(elm)
{
alert(elm.id);
}
BUT, you can't have the same value of
id applied to multiple elements, which makes the document invalid. So, you may need to append the auto-increment id to the value, like
PHP Code:
echo '<tr><td><input type="checkbox" name="box" id="index'.$row['sid'].'" value="'.$id.'" onclick="go_java(this)">';