I want to set php value as per javascript variable.
I want <?php $result = "x" ?> instead of alert("You selected: " + x);
In this code:
<script type="text/javascript">
            function selectOption() {
                var x = document.getElementById("item1").value;
                alert("You selected: " + x);
                if (option == "Select Item") { 
                    return true; 
                }<?php
  $stmt = $user_home->runQuery('SELECT * FROM item ORDER BY Sr ASC ');
    $stmt->execute();
    if($stmt->rowCount() > 0)
    {
        while($row=$stmt->fetch(PDO::FETCH_ASSOC))
        {
            extract($row);
            ?>else if (option == "<?php echo $IRN ?>") {
                return true;
            }
    <?php }} ?>
                    return false;
            }
        </script>
