Skip to content

Commit 40aa7bc

Browse files
authored
Show textarea when page first loads
I didn't even use an LLM to write this!
1 parent 98408bd commit 40aa7bc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

word-counter.html

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
<!DOCTYPE html>
23
<html lang="en">
34
<head>
@@ -208,6 +209,11 @@ <h1>Word counter</h1>
208209
container.appendChild(newSection)
209210
newSection.querySelector('textarea').focus()
210211
})
212+
213+
// Click the button once if there's nothing on the page
214+
if (!document.querySelectorAll('textarea').length) {
215+
addButton.click();
216+
}
211217
</script>
212218
</body>
213219
</html>

0 commit comments

Comments
 (0)