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

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -