-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// JavaScript Document | ||
|
||
//make variabel | ||
let textArea = document.getElementById('textArea'); | ||
let btn = document.getElementsByTagName('button')[0]; | ||
|
||
// check if you click on the button | ||
btn.addEventListener('click', function(){ | ||
|
||
//check if textarea is blank | ||
if(textArea.value==""){ | ||
//give alert | ||
alert("Please don't be blank!"); | ||
|
||
//check if you has been enter a text on textarea | ||
}else{ | ||
|
||
//init responVoice speak | ||
responsiveVoice.speak( | ||
|
||
//take the tag textarea | ||
textArea.value, | ||
|
||
//choose us english female | ||
"US English Female", | ||
{ | ||
|
||
//give a voice | ||
pitch: 1, | ||
rate: 1, | ||
volume: 1 | ||
} | ||
); | ||
} | ||
}); |