I’m new to JS I have input and textarea I want to reset the textarea’s value, if input is changed
<!doctype html>
<HTML lang="en">
<HEAD>
<META charset="utf-8">
<META name="viewport" content="width=device-width, initial-scale=1">
<TITLE>Hello, world!</TITLE>
</HEAD>
<BODY>
<INPUT type="text">
<TEXTAREA>AAAA</TEXTAREA>
</BODY>
</HTML>
>Solution :
first why you are typing in UPPERCASE, this is old html, in HTML5 you should write the tags in lowercase.
to reset the textarea inner text when the input’s value change, as I understand from your question you only have to add Event Listener
document.querySelector('input').addEventListener('change', function(){
document.querySelector('textarea').innerText = "";
});
example
document.querySelector('input').addEventListener('input', function() {
document.querySelector('textarea').innerText = "";
});
<input type="text" />
<textarea>textarea</textarea>