HTML Input is not updating value attribute on change

后端 未结 2 696
名媛妹妹
名媛妹妹 2020-12-06 21:33

OOPS, Since the \"name\" field was at the top it was the one I was testing with, and it turned out that was the only one with an issue. Must have something

相关标签:
2条回答
  • 2020-12-06 21:45

    Agree With @Quentin Dom Contain Live Value and HMTL Input contain Default Value for an input So for Changing the Default Value of the input use This Javascript Trick

    document.getElementById("myText").defaultValue = "Goofy";
    
    0 讨论(0)
  • 2020-12-06 21:56

    The value attribute contains the default value for an input, not the live value.

    The DOM value property contains a live value.

    0 讨论(0)
提交回复
热议问题