How do you check if user typed the specific text inside the textarea tag? Here is an example
</head>
<body>
<textarea>
</textarea>
<div class="box">
</div>
<script>
(this is just example)
if = user typed inside textarea this =("display (hi)")
do = build element inside .box the user typed inside the () of the text "display"
</script>
I really don’t know how to do it i try to search it but none appeared and if you’re confused with code it just glitched
>Solution :
I hope it will give you idea.
If use type any text and includes hi in textarea. It’s will show all text in box container.
let textarea = document.querySelector("textarea");
let box = document.querySelector('.box');
textarea.addEventListener('keyup', (e) => {
if (e.target.value.includes("hi")){
box.innerHTML = "";
box.append(`${e.target.value}`);
}
})