I tried everything and I just wanna toggle my elements
14:23 17 Nov 2025

I'm doing a mini project for a coding bootcamp and I'm trying to toggle elements.

I have a form on my page that I want to make invisible when you submit it, so that the rest of the page shows. It isn't working.

I tried style.visibility. I tried classList.toggle(). I even tried disabling my extensions in Chrome after ChatGPT suggested it, becaause I keep getting this error :

Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

What am I doing wrong?! I tried literally everything I can think of and nothing works!

javascript debugging error-handling toggle