23/23 100% 20строк кода

var template = document.querySelector(’#message-template’).content.querySelector(’.chat-message’);
var mesBlock = document.querySelector(’.chat-content’);
var chatForm = document.querySelector(’.chat-form’);
var messInput = chatForm.querySelector(’.chat-form-input’);

var delMessage = function(message){
var button = message.querySelector(’.chat-message-button’);
button.addEventListener(‘click’, function(){
message.remove();
})
};

chatForm.addEventListener(‘submit’, function(evt){
evt.preventDefault();
var messageBlock = template.cloneNode(true);
messageBlock.children[1].textContent = messInput.value;

mesBlock.appendChild(messageBlock);
delMessage(messageBlock);
messInput.value = ‘’;
})