dimanche 20 novembre 2016

execute php statement if javascript condition is true

I'm trying to execute a php statement if my javascript condition is true so i write this little code :

<input id="checkbox1" type="checkbox"> MSI<br></input>
<script>
$(document).ready(function(){
    $('input[type="checkbox"]').click(function(){
          if ($('#checkbox1').is(':checked')) <?php echo "Bonjour le monde";?>;

        });
});
</script>

But this don't work, if someone can help me it will be great.

Aucun commentaire:

Enregistrer un commentaire