Hi! I'm learning JavaScript and wanted to test out some coding on a demo self-hosted site I have. What surprised me was when I entered a few lines of basic JavaScript coding and tried to set the page up to be password protected, the JavaScript seemed to cancel out the password protection aspect. After I deleted the JavaScript and reset the password to something different, it worked again.
I'm a 100% newbie to JavaScript but am very familiar with HTML and WordPress and want to make sure I understand cause and effect.
Can anyone please help me understand what happened and why?
Thanks.