The task is as follows:

There is a <Input Type = 'Text'> into which text is entered. It is necessary that this text be displayed in real time in a Div. If you use standard events like OnChange, then the text will be updated in the Div only when you move the focus of the mouse to another element, the same with other standard events. And it is necessary that it be displayed at the same moment when it is entered.

    1 answer 1

    Instead of onChange use onKeyDown

    • From pasting from the clipboard this will not save ( - Grigory Ponomarev
    • Well, you can screw oncontextmenu ... - Rules
    • you can still add an onkeyup handler to onkeydown (ctrl-v at least works out) - Yura Ivanov
    • adding a timer helped, I don’t know the truth of how correct it is, but it works :) - Grigory Ponomarev