Why doesn’t the computer speak the text in <body>
element when I click on it?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body onclick="confirm(this.textontent)?speechSynthesis.speak(new SpeechSynthesis(this.textContent)):"";'>
Good morning!
</body>
</html>