@MartineauRemi
Posted
Hey !
-
For the button, you have to change the onclick attribute from "myFunction" to "myFunction();'
-
Since you created a variable called 'icon', I think you need to replace
social.style.display
with
icon.style.display
- Also, you're trying to access the div with the class 'social' with the method 'getElementsByClassName'. The problem is that this method returns an array of the elements found having the corresponding class. Either try to access the first element of the returned array:
var icon = document.getElementsByClassName('social')[0];
or you can access it like this (probably better) :
var icon = document.querySelector('.social');
The second method basically means that you're getting the first element having the class 'social'.
Hope that helps :) Happy coding !
Marked as helpful