Show PHP code within JS

0

I would like to be able to display PHP code within my code within my example. In my select command to my code Js 1 or 2 as is the case selected,

si $Select1 = 'buenos dias'
y  $Select2 = 'buenas tardes'

I would like to show this when the result is printed:

<script type="text/javascript">
function myFunction() {
    var x = document.getElementById("myCiudad").value;

if (x.match("1"))  {   
    document.getElementById("JSciudad").innerHTML = "<br>'<?php echo $Select1?>'<br>";} 
if (x.match("2"))  {   
    document.getElementById("JSciudad").innerHTML = "<br>'<?php echo $Select2?>'<br>";}  
  }
</script>
    
asked by claus vargas 11.09.2018 в 18:21
source

0 answers