I want to retrieve the content of all textarea
elements inside a particular div. Here is how I tried to iterate over them
var ta = document.getElementById('parent').getElementsByTagName('textarea')
ta.forEach(element => {
console.log(element);
});
but I get
Uncaught TypeError: ta.forEach is not a function
at HTMLButtonElement.<anonymous> (details:512)
at HTMLButtonElement.dispatch (jquery.min.js:3)
at HTMLButtonElement.r.handle (jquery.min.js:3)
Is this the proper way to get all textarea
elements inside a particular div?
I want to get the content of all of these textarea
elements along with the name of the element. How can I do that?