I am trying to make my son a spelling quiz. I want to enter his weekly words in mysql with id, word, and weekNo fields I am using a js text to speech to say the word, and he types it into a textbox. After he submits it there is a function to check if it is correct, then the next word in the mysql row is spoken. I am getting the next row with...
$.ajax({
type: "POST",
url: "getNext.php",
data: "count=" + $number,
success: function(results){
$('#results').append(results);
}
});
getNext.php
$result = mysql_query("SELECT * FROM spelling LIMIT
{$_POST['count']},1");
while($row = mysql_fetch_array($result))
{
echo "<div class='result'>".$row['word'] ."</div>";
}
On the index.php I can display $row['word'] one by one on submit with
<div id='results'></div>
My problem is I don't know how to get the value from the ajax call into the TTS, everything I try it says "object HTMLDivElement"
Here is the line where I need to get the ajax value...
var message = new SpeechSynthesisUtterance(AJAX.VALUE.HERE);