I have this code.
It's working fine for first var but its showing undefined variable for second.
How I suppose to solve this?
Here is my code:
<script>
var p1 = "success";
var time = document.getElementById("time").innerHTML;
</script>
<body>
<div id="time">04:00</div>
<?php
echo "<script>document.writeln(p1);</script>";
echo $timevalue = "<script>document.writeln(time);</script>";
?>