0
I want to pass a variable that is in php, for 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 doesn’t work.
Do you think this answer was correct for your question? If yes you can mark as certain.
– Sergio