connect javascript to php variable code example
Example 1: how to use php variable in javascript file
alert("color: " + color);
Example 2: how to use php variable in javascript file
<?php
$bool = false;
$num = 3 + 4;
$str = "A string here";
?>
alert("color: " + color);
<?php
$bool = false;
$num = 3 + 4;
$str = "A string here";
?>