Skip to content

Commit

Permalink
Create script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
galihap76 authored Sep 8, 2022
1 parent cd7f6f0 commit 3677a9c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions script.js
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
}
);
}
});

0 comments on commit 3677a9c

Please sign in to comment.