Difference between value and defaultValue value for entering text in Javascript?

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

Are they free interchangeably? that is, does one other change another?

+3
source share
2 answers

defaultValue- this is the initial value of the object, and value- the current value of the object after making changes. If no changes have been made, valueequal defaultValue.

uhmm ... looking for a link, wait.

+3
source

In the example

<INPUT TYPE="password" NAME="password" VALUE="admin" SIZE=25>

, "defaultValue" "admin", , "" .

"defaultValue" : http://www.java2s.com/Code/JavaScriptReference/Javascript-Properties/defaultValueisappliedto.htm

0

Source: https://habr.com/ru/post/1768004/


All Articles