$finalval=0;
while($row = mysql_fetch_array($result))
{
$finalval=$finalval. "<a href='#'
onClick='showContent(".json_encode($row['ID']).")'>". $row['Title'] . "</a> <br>" ;
}
echo $finalval;
<script language="javascript" type="text/javascript" >
function showContent(value)
{
alert(value);
}
</script>
Please rectify my error alert box is displaying null instead of ID value.Thanks
See Question&Answers more detail:os