Setting the value
is normally used for input/form elements. innerHTML
is normally used for div, span, td and similar elements.
value
applies only to objects that have the value attribute (normally, form controls).
innerHtml
applies to every object that can contain HTML
(divs, spans, but many other and also form controls).
They are not equivalent or replaceable. Depends on what you are trying to achieve
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…