The question is published on by Tutorial Guruji team.
I have a Marketo form which I want upon form submission to hide all form elements and show a div (class of “thank-you”), and I keep getting the error
Uncaught TypeError: Cannot read property 'remove' of undefined. Any ideas what I may be doing wrong?
<div class="thank-you hide"> message </div>
getElementsByClassName method returns a collection of all elements in the document with the specified class name, as a NodeList object, so you need access it by passing index