Samsam,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.hide{
display: none;
}
</style>
<script>
window.addEventListener('DOMContentLoaded', function() {
[].forEach.call(document.querySelectorAll('.test'), function(item) {
item.addEventListener('click', function() {
item.classList.add("hide")
});
});
});
</script>
</head>
<body>
<div class=test>1</div>
<div class=test>2</div>
<div class=test>3</div>
</body>
</html>