Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between value and defaultValue for a text input in Javascript?

What is the difference between value and defaultValue for text inputs in Javascript? And what are the implications of using one instead of the other?

Are they free interchangeable? i.e., does changing one change the other?

like image 645
JSCoder Avatar asked Oct 13 '22 23:10

JSCoder


1 Answers

defaultValue is the initial value of the object while value is the current value of the object after a change has been made. If no changes has been made, value is equal to defaultValue.

uhmm... looking for reference, wait.

like image 124
Reigel Avatar answered Oct 16 '22 14:10

Reigel