Answer the question
In order to leave comments, you need to log in
Should the function be executed only once when the button is clicked?
Here is such a function:
socket.on('add mess', function(data) {
$all_users.append("<div>"+ data.name + "</div>");
});
Answer the question
In order to leave comments, you need to log in
The algorithm is this:
FunctionName
button.removeEventListener("click", FunctionName)
button.addEventListener("click", FunctionName)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question