Run php code inside .html() jQuery function

PHP within JavaScript/jQuery will not work.

So try,

<?php echo '<script>$(function() {
       $("#btnExistReceiver").click(function() {
          $("#receiverForm").css("display", "block");
          $(this).html("<i class=\'fa fa-user\'></i>'.__( ' Existing R ').'");        
          });
      });</script>';
?>

Leave a Comment