I'm generating a table through ajax function. But I need to add onclick function.Inside this function passing two parameters one is number and other is name.
Controller
$table.=' <td><input type="checkbox" value="" id="sp_'.$app_id.'" onclick="SpDetails('.$app_id.','.$app_details->app_name.');" /></td>'
echo $table;
script
function SpDetails(val,name)
{
alert(name)
}
But I didn't get the name when I alert.