I am trying to obtain the value of a specific text area on a form, in a separate javascript file.
I have tried code specified in this stackoverflow link: Get textarea by name attribute
however I still obtained null, as the output.
my code is here as follows:
<td>
<textarea name="key_input" rows="4" cols="50">
testData
</textarea>
</td>
and in my js:
var key_Data = document.getElementById("key_input").value;
this is another way I have tried to obtain the key_input data, but I am still unsuccessful.
Any help would be much appreciated Thanks in advance.