i have combined javascript with php as shown in this code below. but is not working for me. it doesn't display the content. but it display the id when is requested.
function content24(){
document.getElementById("dailypost_content").innerHTML = '<?php
$query = "SELECT`dpost_content` FROM `daily_POST` WHERE `id`=
'24'";
$query_run = mysqli_query($host_connection, $query);
$query_row = mysqli_fetch_assoc($query_run);
$content = $query_row['dpost_content'];
echo '<span id "daily_caption"> <strong><u>Daily Inspiration</u>
</strong><br></span>';
echo $content;
?>';
}