Difference between Element.value and Element.getAttribute(“value”)

The difference is that element.value is real time and if a user changes let’s say, a textbox input, it will reflect that, and show you the new value.

While getAttribute('value') will still show the original value="whateverWasHere" value.

jsFiddle DEMO

Leave a Comment