Title: TypeError: document.getElementById(&#8230;) is null
Last modified: December 14, 2018

---

# TypeError: document.getElementById(…) is null

 *  Resolved [sebas6691](https://wordpress.org/support/users/sebas6691/)
 * (@sebas6691)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/)
 * I’m getting this error in my console everywhere:
    TypeError: document.getElementById(…)
   is null
 * The error line:
    <script type=”text/javascript”>document.getElementById(“vscf-
   anchor”).scrollIntoView({behavior:”smooth”, block:”center”});</script>
 * How to solve this?
    Thank you in advance!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftypeerror-document-getelementbyid-is-null%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/#post-10991712)
 * Hi,
 * That’s not nice. Have to look into this, but right now I think it has something
   to do with the form anchor (option “Scroll back to form position after submit”)
   being present at your form or not. Will keep you informed.
 * Guido
 *  Plugin Author [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/#post-10998211)
 * Hi again,
 * It should be fixed in new version. Could you please tell me the outcome after
   you’ve updated plugin?
 * Guido
 *  Thread Starter [sebas6691](https://wordpress.org/support/users/sebas6691/)
 * (@sebas6691)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/#post-10998310)
 * Hi Guido,
 * Thank you for looking into this!
    I’ll let you know if it is resolved!
 * Best,
    Sebastiaan
 *  Thread Starter [sebas6691](https://wordpress.org/support/users/sebas6691/)
 * (@sebas6691)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/#post-10998690)
 * Jup it’s fixed!
    Thanks!
 *  Plugin Author [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/#post-10999041)
 * Great! Marking this thread as resolved.
 * Guido
 *  [jacobhalls](https://wordpress.org/support/users/jacobhalls/)
 * (@jacobhalls)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/#post-11243594)
 * This error TypeError: [document.getelementbyid(…) is null](http://net-informations.com/js/iq/error.htm)
   would seem to indicate that there is no such element with an ID passed to getElementById()
   exist. This can happen if the JavaScript code is executed before the page is 
   fully loaded, so its not able to find the element. The solution is that you need
   to put your JavaScript code after the closure of the HTML element or more generally
   before < /body > tag.
 *  Plugin Author [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/#post-11245555)
 * Hi,
 * In this case the “element” is only active (being used) if scroll to anchor is
   set to true, so I forgot to check for it’s presence.
 * Guido

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘TypeError: document.getElementById(…) is null’ is closed to new replies.

 * ![](https://ps.w.org/very-simple-contact-form/assets/icon-256x256.png?rev=1415751)
 * [VS Contact Form](https://wordpress.org/plugins/very-simple-contact-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/very-simple-contact-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/very-simple-contact-form/)
 * [Active Topics](https://wordpress.org/support/plugin/very-simple-contact-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/very-simple-contact-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/very-simple-contact-form/reviews/)

## Tags

 * [javascript error](https://wordpress.org/support/topic-tag/javascript-error/)

 * 7 replies
 * 3 participants
 * Last reply from: [Guido](https://wordpress.org/support/users/guido07111975/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/typeerror-document-getelementbyid-is-null/#post-11245555)
 * Status: resolved