-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
29 lines (23 loc) · 970 Bytes
/
script.js
File metadata and controls
29 lines (23 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
document.addEventListener("DOMContentLoaded", function () {
const button = document.getElementById("simplifyBtn");
button.addEventListener("click", simplifyText);
});
function simplifyText() {
const inputText = document.getElementById("inputText").value;
const outputDiv = document.getElementById("output");
if (inputText.trim() === "") {
outputDiv.innerHTML = "Please enter some text first.";
return;
}
// Fake simplication logic
let simplified = inputText.split(".")[0].trim(); // Take this first sentence only
if (!simplified.endsWith(".")) {
simplified += ".";
}
outputDiv.style.display = "block";
outputDiv.innerHTML = `
<strong>Simplified Version:</strong><br><br>
👉 In simple terms: <br><br>
${simplified}
`;
}