I try to get content from database before submitting the form.I call javascript function in onload method.When I Directly write php code into textarea it works but when I append same php content to textarea through JS its not working, total php content only shown in textarea.Thanks in advance.
var parent=document.getElementById("textarea");
var child=document.createTextNode(' <?php '+
' include "conn.php"; '+
' $q1="SELECT `breakfast` FROM `foodmenu` WHERE `day`=\'Wednesday\'"; '+
' $result=$conn->query($q1); '+
' while($row=$result->fetch_assoc()) '+
' { '+
' echo $row["breakfast"]; '+
' } '+
' ?> ');
parent.appendChild(child);