why can't this work? I want it to speak the output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

why can't this work? I want it to speak the output

<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <script src='https://code.responsivevoice.org/responsivevoice.js'> function sayHello(name) { alert("Hi " + name + ", welcome to your math test score , please click next to continue🤗"); document.write("Hi, " + name + " "); } sayHello( prompt("HELLO,PLEASE ENTER YOUR NAME") ); var maths; //math section maths=parseInt(prompt("Enter Your Maths score")); if(maths>=101) document.write( "YOUR MATH SCORE CAN'T BE GREATER THAN 100" + "<br />" +"and"+ "<br />"); else if (maths>=50 ) responsiveVoice.speak(maths); document.write("congrat, you have passed in Maths"+ "<br />" +"and"+ "<br />"); responsiveVoice.speak(maths); </script> </body> </html>

26th Mar 2019, 12:36 PM
Glory222
Glory222 - avatar
3 Answers
+ 5
responsiveVoice.voiceSupport() appears to return false for Code Playground. According to the FAQ, the library appears to have limited support for Android devices. It may work on Chrome on Android, and native browsers, but apparently not on Code Playground. https://responsivevoice.org/faq/
26th Mar 2019, 12:58 PM
Hatsy Rei
Hatsy Rei - avatar
+ 2
A script tag can either have a src attribute or can contain JS code but not both. You're using the same script tag to embed link as well as for writing JS code. Write your JS code in a separate script tag and it'll work.
26th Mar 2019, 12:59 PM
Шащи Ранжан
Шащи Ранжан - avatar
+ 1
Could someone rewrite it for me!? I'm really bad at this language (js)
26th Mar 2019, 1:09 PM
Glory222
Glory222 - avatar