Answer the question
In order to leave comments, you need to log in
How to send a message only to recipients from the list?
After authorization, I enter socket.id into an array. How to send a message only to them?
socket.emit('block_item', {itemId: data.id});
Answer the question
In order to leave comments, you need to log in
Because the script is included in the head and the DOM has not yet been formed at the time the element is searched.
Because you need to store the DOM element you received earlier in a variable
var myElement = document.getElementById('message').innerHTML = 'Hello';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question