Reputation: 2052
Okay, I've seriously got to be missing something or I'm crazy. Here's the code I'm having an issue with, it is inside an onchange event:
console.log( (this.parentNode.parentNode) );
// fine prints the elements
console.log( (this.parentNode.parentNode).getElementsByName('otherposition[]') );
// gives me undefined error
(this.parentNode.parentNode).getElementsByName('otherposition[]')[0].style.opacity = '1';
// same error.
Upvotes: 0
Views: 160
Reputation: 117324
getElementsByName
is a method of document
, elements doesn't have such method.
Upvotes: 3