I am using a php file ( not HTML ). I want to create a button and call a function when I click it. I try it but onclick is not working.
My code:
echo "<input type= 'button' value='save' onclick='save()'>";
echo " <script>
function save(){ alert('save func');}
</script>";
edit 1: in the web console: save is not defined. The error occures from:
onclick='save()';
i try:
onclick='javascript:save()';
but, the same error.