Title: Javascript console error
Last modified: September 2, 2022

---

# Javascript console error

 *  Resolved [Alessandro Carrera](https://wordpress.org/support/users/alessandrocarrera/)
 * (@alessandrocarrera)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/)
 * Good morning,
    I found this console error on my browser console in the backoffice
   area of WordPress:
 * `Uncaught TypeError: Cannot read properties of null (reading 'getElementsByTagName')`
 * The stacktrace tells me that the error starts from this point:
 * `easy-table-of-contents/assets/js/admin.js`
 * Can you check this please? On WordPress version minor of 6 this is the cause 
   of a fatal javascript error that block their execution. Thank you!

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

 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15974435)
 * Can you please share the screenshot of it? So that we will go through it and 
   get back to you immediately.
 *  Thread Starter [Alessandro Carrera](https://wordpress.org/support/users/alessandrocarrera/)
 * (@alessandrocarrera)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15979120)
 * Hi, thank you for your reply.
    Yes this is a screenshot of the problem:
 * [https://ibb.co/tqYWwjz](https://ibb.co/tqYWwjz)
 * I use WordPress `6.0.2` with PHP `7.4`. Please tell me if you need some other
   information. Thank you again!
 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15979652)
 * The given screenshot link is not working. Can you please cross-check once and
   send us the working screenshot? So that we will go through it and get back to
   you immediately.
 * Reference screenshot: [https://prnt.sc/hRfGeKIJpGmq](https://prnt.sc/hRfGeKIJpGmq)
 *  Thread Starter [Alessandro Carrera](https://wordpress.org/support/users/alessandrocarrera/)
 * (@alessandrocarrera)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15980092)
 * Sorry, this is a new link using the same provider of your screenshot:
 * [https://prnt.sc/oXGE7abjJQT2](https://prnt.sc/oXGE7abjJQT2)
 * Thank you again!
 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15987213)
 * Thanks for sharing. Will you please create a small video or explain to us step
   by step to recreate the issue you are facing so that we can check the same and
   come up with a solution?
 *  [Lucas Karpiuk](https://wordpress.org/support/users/karpstrucking/)
 * (@karpstrucking)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15987363)
 * This is very easy to recreate, simply install/activate the plugin and check the
   JS console while navigating literally anywhere in the WP admin dashboard.
 *  Thread Starter [Alessandro Carrera](https://wordpress.org/support/users/alessandrocarrera/)
 * (@alessandrocarrera)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15987413)
 * [@karpstrucking](https://wordpress.org/support/users/karpstrucking/) exactly!
   [@magazine3](https://wordpress.org/support/users/magazine3/) this is the flow
   for recreate the issue.
 *  [Muslim Ahmed Khan](https://wordpress.org/support/users/muslimahmedkhan/)
 * (@muslimahmedkhan)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15993588)
 * Hey [@alessandrocarrera](https://wordpress.org/support/users/alessandrocarrera/)
   sir,
 * We added this issue on GitHub:
    [https://github.com/ahmedkaludi/Easy-Table-of-Contents/issues/269](https://github.com/ahmedkaludi/Easy-Table-of-Contents/issues/269)
 * On the last update version 2.0.33.2, we have removed this bug on admin.js file,
   please check this:
    [https://plugins.trac.wordpress.org/browser/easy-table-of-contents/trunk/assets/js/admin.js](https://plugins.trac.wordpress.org/browser/easy-table-of-contents/trunk/assets/js/admin.js)
 *     ```
       var ezTocSettingsWidth = document.getElementById('ez-toc-settings[width]');
           var ezTocSettingsCustomWidth = document.getElementById('ez-toc-settings[width_custom]');
   
           if(ezTocSettingsCustomWidth) {
               if(ezTocSettingsWidth.value != 'custom')
                   ezTocSettingsCustomWidth.parentNode.parentNode.style.display = "none";
   
               ezTocSettingsWidth.addEventListener('change', function () {
                   if (document.getElementById('ez-toc-settings[width]').value == 'custom') {
                       ezTocSettingsCustomWidth.parentNode.parentNode.style.display = "revert";
                   } else {
                       ezTocSettingsCustomWidth.parentNode.parentNode.style.display = "none";
                   }
               });
           }
       ```
   
 * So, can you check now and let us know if this is fixed or not after the update
   on latest version of this Easy Table of Contents plugin?
 * Thanks and Regards
    [@muslimahmedkhan](https://wordpress.org/support/users/muslimahmedkhan/)
   [@magazine3](https://wordpress.org/support/users/magazine3/) Developer
 *  Thread Starter [Alessandro Carrera](https://wordpress.org/support/users/alessandrocarrera/)
 * (@alessandrocarrera)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15993714)
 * [@muslimahmedkhan](https://wordpress.org/support/users/muslimahmedkhan/) thank
   you so much. Fixed!
    -  This reply was modified 3 years, 9 months ago by [Alessandro Carrera](https://wordpress.org/support/users/alessandrocarrera/).
 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15993918)
 * Glad to hear the issue has been resolved. Further, If you have any other queries
   or issues, please reach us by creating a new topic.
 *  Thread Starter [Alessandro Carrera](https://wordpress.org/support/users/alessandrocarrera/)
 * (@alessandrocarrera)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/#post-15993971)
 * [@magazine3](https://wordpress.org/support/users/magazine3/) of course, I will.
   Thank you again!
 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/page/2/#post-15994604)
 * You’re welcome.

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

The topic ‘Javascript console error’ is closed to new replies.

 * ![](https://ps.w.org/easy-table-of-contents/assets/icon-256x256.png?rev=3045459)
 * [Easy Table of Contents](https://wordpress.org/plugins/easy-table-of-contents/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-table-of-contents/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-table-of-contents/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-table-of-contents/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-table-of-contents/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-table-of-contents/reviews/)

## Tags

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

 * 17 replies
 * 4 participants
 * Last reply from: [Magazine3](https://wordpress.org/support/users/magazine3/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/javascript-console-error-3/page/2/#post-15994604)
 * Status: resolved