javascript - Mouse event function is not working -
i have declared function in javascript, , when calling onclick
not work.
here code:
function delete(val) { alert(val); }
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> <i class="fa fa-trash" onclick="delete('.$id.');">'.'</i>
delete reserved word in javascript. use different name function.
function del(val) { alert(val); }
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> <i class="fa fa-trash" onclick="del('.$id.');">'.'</i>
Comments
Post a Comment