Search code examples
javascripttextareainnerhtml

JavaScript get TextArea input via .value or .innerHTML?


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

Thank you.


Solution

  • You should use .value

    myTextArea.value