I encountered an issue while working with a script; here is the code snippet in question:
if (form.elements[i].type === 'text') {
// do stuff
}
The code works as expected for input type=text, but not for textarea. I tried modifying it like this:
if (form.elements[i].type === 'text' && form.elements[i].type === 'textarea') {
// do stuff
}
Despite the modification, the code still does not work on textarea elements. Any suggestions or ideas to resolve this issue would be greatly appreciated.