javascript is only taking first checkbox value it is not taking other checkbox value why ? HTML:
<input type="checkbox" id="checkbox" onclick="check()" value="<?php echo $data->id; ?> " >
Javascript:
function check()
{
var id = $('#checkbox').attr('value')
var checkbox = document.getElementById('checkbox');
if(checkbox.checked==true) {
alert(id);
}
else
{
alert('false');
}
}