I have this code:
<html>
<body>
<script>
var x;
if (confirm("Press a button!") == true) {
x = "You pressed OK!";
<?php $kk="ok"; ?>
} else {
x = "You pressed Cancel!";
<?php $kk="not ok"; ?>
}
document.getElementById("demo").innerHTML = x;
</script>
<?php
echo $kk;
?>
</body>
</html>
When I echo $kk
, I obtain always not ok
But I want to print OK or NOT OK. Any helps please?