How can I pass a php variable to the value of a select, whenever a different option is selected.
I have tried as below but it returns me [object HTMLSelectElement]
$("select#tipo_documento").change(function (event) {
var tipo_documento = document.getElementById('tipo_documento').value;
})
<?php
$tipo_documento = "<script>"
. "document.write(tipo_documento)"
. "</script>";
?>