I want to pass a variable that is in php to JavaScript. For example this:
<?php
$color = "Red";
?>
<script type="text/javascript">
var color = <?php $color ?>;
alert("color: " + color);
</script>
I tried this code, but it does not work.