Latest solutions
Latest comments
- @Badhrikr@Rtf747
hi Badhri! I know what's wrong with your code. The clickable element that functions as a button is not a button, but a list item.
I think it would look better to change it to a <button> tag.
The logic of your Javascript is fine, only that when you select the "togglerbutton" element, it returns an array. That's why the toggler effect doesn't work. The same goes for your "card__sharebutton--active" element.
To correct this you can do it this way:
const button = document.getElementsByClassName('togglerbutton')[0];
const media = document.getElementsByClassName('card__sharebutton--active')[0];
By adding "[0]" you are indicating which position in the array you want to access.
Greetings!
Marked as helpful - @samudriawan@Rtf747
Congratulations! The design is very good, but you need to continue learning Javascript, I see that many concepts are not clear to you. But it doesn't matter, don't give up, this is an endurance race, not of speed.