JavaScript for WordPress › Forums › Vanilla JavaScript › 1.3.7.8 Uncaught Type Error › Reply To: 1.3.7.8 Uncaught Type Error
June 25, 2018 at 3:00 pm
#49704
libbeydesign
Participant
No, the example files work as-expected after reviewing the originals again. I may have had something modified in my earlier set of example pages as I was working through the videos. So it was probably just user error.
Question: just for clarification, when trying to change an input field’s value via JS, it ONLY works when the input element has an id assigned to it (using document.getElementByID), correct? I tried a few other forms using document.getElementsByName (because their input elements didn’t have IDs) but it didn’t work.