kiberchainik,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.hide {
display: none;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
function show(elem) {
return function(event) {
event.preventDefault();
elem.classList.toggle("hide")
}
};
var a = document.querySelectorAll('[data-triger]'), b = document.querySelectorAll('.msg_box');
[].forEach.call(a, function(node, i) {
node.addEventListener("click", show(b[i]))
});
var elem = document.querySelector(".users_msg_block");
document.querySelector(".msg_bnt_active").addEventListener("click", show(elem))
});
</script>
</head>
<body>
<div class="msg_block">
<div class="users_msg_block">
<a data-triger="user1" class="new_msg_user"><img src="/images/icons/users/consultation.png" alt="" title="" /></a>
<a data-triger="user2" class="new_msg_user"><img src="/images/icons/users/consultation.png" alt="" title="" /></a>
</div>
<div class="msg_bnt_active">
<a><i class="fa fa-comments-o">user</i></a>
</div>
</div>
<div class="msg_box">
<div class="msg_box_header">
<div><h5>User 1</h5></div>
<div><a><i class="fa fa-times"></i></a></div>
</div>
<div class="msg_box_wrapper">
dialog...
</div>
<div class="msg_box_footer">
<input type="text" name="send_message" />
</div>
</div>
<div class="msg_box">
<div class="msg_box_header">
<div><h5>User 2</h5></div>
<div><a><i class="fa fa-times"></i></a></div>
</div>
<div class="msg_box_wrapper">
dialog...
</div>
<div class="msg_box_footer">
<input type="text" name="send_message" />
</div>
</div>
</body>
</html>