How To use PHP variable in jQuery (in WordPress plugin)

Solution:

You can use PHP variable in JQuery/Javascript easily check below steps

1) Stored PHP variable value in HTML input tag as type hidden

<input type="hidden" value="<?php echo $phpvariabletext;?>" id="phpvariable">

2) After assign variable value in HTML input tag. You can get value in JQuery/Javascript.

<script type="text/javascript">
        var content = $('#phpvariable').val();
        var newmodal = new tingle.modal();
         function openmodal() {
            newmodal.open();
            newmodal.setContent(content);
        }
</script>