JavaScript get TextArea input via .value or .innerHTML?

Francisc picture Francisc · Mar 15, 2011 · Viewed 96.6k times · Source

Is it ok to get the value of a textarea element in JavaScript with myTextArea.value or should I use myTextArea.innerHTML?

Thank you.

Answer

jessegavin picture jessegavin · Mar 15, 2011

You should use .value

myTextArea.value