JavaScript not working in CodePen

Hi, can anyone please help me to figure out why isn’t JS code working in CodePen? Would really appreciate any help.

Welcome there,

Do you mean to assign the value here?:

function toggleModal() {
  if (isOpen = false) {
``

I see, that’s my mistake. But I changed it to === and it still doesn’t work :frowning:

The order/specificity of your CSS selectors is wrong.

Make sure your “opened” selector comes after the initial display: none selectors, or give it a higher specificity, for example using !important.

Thank you so much! :heartpulse:

1 Like