Why onchange dom Ć©vent does not fire ? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why onchange dom Ć©vent does not fire ?

I tried in this <input type="text" value="" onchange="alert('fired event !') /> in the PlayGround and when i run the code, the onchange event does not fire, can anyone tell me the reason ?

17th Jul 2018, 9:28 AM
Youssouf MbaƩ Ahamada Saidou
Youssouf MbaƩ Ahamada Saidou - avatar
5 Respostas
+ 1
onchange its fired when you change the value and your element lose the focus (try to click outside the element after change his value). For get immediate result, use "oninput" P.S. Dont forget to add " for close onchange value because in your posted code its missing
17th Jul 2018, 9:57 AM
KrOW
KrOW - avatar
+ 1
Ok i try oninput
17th Jul 2018, 10:04 AM
Youssouf MbaƩ Ahamada Saidou
Youssouf MbaƩ Ahamada Saidou - avatar
+ 1
Thanks, oninput works well
17th Jul 2018, 10:07 AM
Youssouf MbaƩ Ahamada Saidou
Youssouf MbaƩ Ahamada Saidou - avatar
0
Please insert your code here,so we can check it out.
17th Jul 2018, 9:55 AM
Jonas Schrƶter
Jonas Schrƶter - avatar
0
šŸ‘šŸ‘šŸ‘
17th Jul 2018, 10:08 AM
KrOW
KrOW - avatar