var val;
$('select').on('change', function() {
alert( this.value );
val = this.value;
})
<?php
echo $variable = "<script>document.write(val)</script>";
?>
<select>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
<option value="4">four</option>
</select>
I want to get the value of the selected box and save it in a PHP variable. I want to save and echo val
variable. Please help