Why is this line of JS code returning the error "cannot set property ... of undefined"?
document.forms["myForm"]["english_error"].textContent = "English sentence is required";
I am referencing the id of my div element correctly.
<input type="text" id="english" name="english" placeholder="English sentence" />
<div id="english_error" class="val_error"></div>
myForm, not all elements with an ID will show up as properties of theformelement. Mainly form controls will.