Can you please take a look at this code and let me know why I am not able to pass variable value from PHP to jQuery?
<?php
$data = "This is For Test";
?>
<!DOCTYPE html>
<head> </head>
<body>
<button id="test" type="button" class="btn btn-default">Default</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
var data = "<?php $data; ?>";
$("#test").on("click",function(){
alert(data);
});
</script>
</body>
</html>
Thanks