var outerDiv = document.getElementsByClassName('div1')[0];
if(outerDiv.offsetHeight === 500) {
var divChild = outerDiv.children;
for(var i = 0, max = divChild.length; i < max; i++)
divChild[i].style.display = 'block';
}
(function() {
document.getElementById('text').addEventListener('mousedown', addClickListener);
function addClickListener(event) {
if(event.button == 2) return;
event.preventDefault();
alert(event.button);
}
})()