title: How to play google tts on click using javascript
body: <p>I'm trying to write a js function that can speak certain text, like this"</p>
  
  <pre><code>function SpeakText(text) {
  ......
  }
  </code></pre>
  
  <p>I found this tread: <a href="https://stackoverflow.com/questions/3341575/how-to-create-a-button-that-plays-a-mp3-google-tts">how to create a button that plays a mp3 google tts</a> that seems to do what I want. But I tried the solutions but doesn't work. Maybe it requires html5 to work?</p>
  
  <p>Is there a simple javascript function that can simply speak certain text that I input to it?</p>