mardi 2 juin 2015

Checkbox From Json is not showing alert when clicked

I am passing some check box input from JSON into HTML, and when that checkbox was clicked showing some alert and that not working. This is my code

 $aroundCheck='<div id="content">';foreach ($checkLocation as $checkLocation) {
   $aroundCheck.='<input type="checkbox" name="check[]"/>'.$checkLocation->id_object;
 }
 $aroundCheck.='</div>';
 $result = array('status' => 'ok', 'content' => $aroundCheck);
 echo json_encode($result);

the javascript

$('input=[name="check[]"]').click(function(){ alert("Something");});

anybody know? help me im stuck for 2 days




Aucun commentaire:

Enregistrer un commentaire