I think i might be losing it…
if anyone could shed some light I would greatly appreciate it.
here’s the exercise and my code, follow by the official solution which i commented out.
Is there any reason why the code works when i comment out my solution and run supplied code but doesn’t work when i run mine?
they are IDENTICAL!!! (or am i missing something?)…
thanks
code:
let social = document.getElementById('social-media');
let share = document.getElementById('share-button');
let text = document.getElementById('text');
let sharePhoto = function(event) {
event.target.style.display = 'none';
text.innerHTML = 'You share the puppy in ' + event.timeStamp + ' ms.';
}
share.onclick = sharePhoto;
/*
let sharePhoto = function(event) {
event.target.style.display = 'none';
text.innerHTML = 'You share the puppy in ' + event.timeStamp + ' ms.';
}
share.onclick = sharePhoto;