What is prevent default() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is prevent default()

prevent default()

20th Oct 2017, 1:05 AM
Ikbal Mulyadi
Ikbal Mulyadi - avatar
2 Answers
+ 4
Well I don't understand why someone dislike your question anyway First of all what does prevent mean? Yes It mean "block" so preventDefault() prevent from doing as its default And this function is method of event object (Look at line 11 straightly) Such as this code By default you can press the key on input area but preventDefault will prevent you from press any keys on that input area https://code.sololearn.com/WyiIXCPMA7QM/?ref=app
20th Oct 2017, 2:59 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 2
thanks for your awnser
20th Oct 2017, 5:59 AM
Ikbal Mulyadi
Ikbal Mulyadi - avatar