I need to append a DOM element to another using javascript or jQuery, and this DOM element has to contain a translatable string using PHP like so:
<?php echo $this->__("submit"); ?>
I tried something like:
var string = '<?php echo $this->__("submit"); ?>';
jQuery('.my-element').append('<span>' + string + '</span>');
But the php part is rendered as plain text. Is there a way to accomplish something like that?