I want to process the input to the text area in real time and reflect it to another text area.

Asked 2 years ago, Updated 2 years ago, 299 views

Like Google Translation, I would like to immediately reflect what I type on the left to the right, but I would like you to give me an overview of what kind of technology (appropriate programming language) is used and how it is made.

I haven't got a clue at all, so I'd appreciate it if you could tell me some keywords.
By the way, apart from Google translation, deeppl is what I am looking for.

javascript

2022-09-30 21:59

1 Answers

https://developer.mozilla.org/ja/docs/Web/API/HTMLElement/change_event#text_input_element

You can invoke the handler for each key entry in the onInput event of the input element
All you have to do is take in and out the value from the input DOM

const output= document.getElementById('output');

function f(e){
  output.value = e.value;
}
Input<input type="text" onInput="f(this)"/>
<br>
Output <input type="text" id="output"/>


2022-09-30 21:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.