moment().add(-1, 'day')
moment().add(-1, 'day').format('Do MMMM')
var parent = document.querySelector('.parent');
var childLength = document.querySelectorAll('.child').length;
var countClick = 0;
parent.onclick = function(event) {
var target = event.target;
if (target.className == 'child') {
target.className = 'child child-click';
console.log(countClick);
countClick++;
setTimeout(function() {
target.className = 'child child-hide';
}, 3000);
}
if (childLength == countClick) {
setTimeout(function() {
parent.innerHTML = 'All right';
}, 3000);
}
}