I have a HTML element. When I click on it, it calls a javascript function and inside the function I want to make a database update and hence for that I need php scripting. I tried doing the following
<script>
function myMethod(){
<?php
MyPHP code
?>
}
</script>
But it did not work. What can I do?