Difference between “[removed]” and “.value” in JS

前端 未结 3 1034
死守一世寂寞
死守一世寂寞 2020-11-27 22:03

I am confused on what is the difference between .innerHTML and .value in JavaScript. Here is my code:


Input string: &         


        
3条回答
  •  误落风尘
    2020-11-27 22:27

    .value gives you the currently-set value of a form element (input, select, textarea), whereas .innerHTML builds an HTML string based on the DOM nodes the element contains.

提交回复
热议问题