I was going to run krimaction1,  a PH function when the JavaScript runs, but I've not had any luck solving this and I'm not really good at JS. How can I run that PHP function in the JavaScript?
Here is the code I've tried so far
<?php
function krimaction1() {
    echo"IT IS ALIVE!";
}
?>
<script>
    $(function(){
        $('#krim_1').click(function(){
            alert(this.id);
            var myTD = this.id.split('_')[1];
            var newFrm = '<form id="myNewForm1"><input name="newdata" value="' +myTD+ '" /></form>';
            $('body').append(newFrm);
            $('#myNewForm').submit();
        });
    });
</script>
I've tried another method with this as my JS:
function myFunction() {
    document.getElementById("ThisIsTheValue").value = "Johnny Bravo";
    document.getElementById("SubmitForm").click();
}
but that code doesn't work either for me, as when I try to set the value with the JS and click it it doesn't do anything and I can't really see what's wrong.
 
     
    