@Kerri-AnnBates
Posted
Hi, I think this looks great! Good job. I saw a comment in your js file about this line of code not working:
x.style.visibility ="hidden" ? "visible" : "hidden";
It probably did not work because your condition is assigning the visibility style to "hidden". I think what you're looking for is the equality operator. Using ==
instead of =
Like so:
x.style.visibility =="hidden" ? "visible" : "hidden";
That may work. Hope that makes sense and that it helps :)
@jfprentice
Posted
Thanks for looking at my code! I definitely overlooked that I was using the assignment operator - I'll go back and see if that was the culprit! Thanks again!
@Kerri-AnnBates
Posted
@jfprentice You're welcome! I actually read up on this myself after seeing your code and found out that, the solution I posted in my previous comment would not work either because x.style
will only work to check inline styles and not styles from an external stylesheet.
After some research I came across this documentation: (https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle) which looks like is a more likely way to check if an element's css property has a specific value. Something else you can look at. I learned something new with this too!
@jfprentice
Posted
@Kerri-AnnBates I did go back and change the operator but with no result. That's good to know about .style though! I have a lot to learn when it comes to JS and DOM manipulation. Thanks for the link!