winestriada.blogg.se

Keyup event
Keyup event








keyup event

Part of that paragraph, either so console.log('event'). QuerySelector was it called input-to-copy, input-to-copy. > Brian Holt: And here I would say, documents.getelement or querySelector. So it would be the input in this particular case and then I wouldn't have to have this part at all. So that's what the event.target is, right? It's where the event actually ended up happening. So the wherever the event is happening, right? So in this case, the event happens on this input right here. So this takes in an event right here, right, and then I could have said. > Brian Holt: Or we actually could have done it this way, as well. Whatever the person has typed into it will always be captured inside input.value here. So the input.value which this input is this, it's the input to copy to which is referring to this one right here. And here I'm just saying, paragraph and I'm saying the inner text is assign the input.value, right? So if you look, trying to listen to inputs, you'll listen for key up events. So I would be always one character behind, but sometimes that's what you want. > Brian Holt: Reason being if I did key down on here, it would capture the event before the typing had been registered. > Brian Holt: As soon as I let up my fingers, if I would like hold my finger here, notice that it's not gonna do anything until I let my finger up. So if I type in here and say, typing something. And then as soon as I released the key up, there is a key event, okay, and listening to the key up event. Brian Holt: So I'm gonna show you another one with input tag, right? So something that I can type into and we're gonna be listening to key up events, okay? So key up event, as you might imagine is when I press the key, there is a key down event.










Keyup event