Answer the question
In order to leave comments, you need to log in
How to convert a line of html code to js into just html?
In general, I use a database to create a chat, all the text that someone wrote is stored in me like this: (p class='uid') (text) (/p) this is necessary so that if something happens, the moderator could ban the violator, but for this he needs to know the uid that is in the class, here is my code:
however, it is output like this:
Answer the question
In order to leave comments, you need to log in
text = name + ': ' + text + '[@Admin]';
text += '<p class=""'> + text + '</p>';
$(text).addClass(userData.uid);
ref.push({text: text});
text = name + ': ' + text + '[@Admin]';
text += '<p class=""' id="item' + userData.uid + '"> + text + '</p>';
$('#item' + userData.uid).addClass(userData.uid);
ref.push({text: text});
text = name + ': ' + text + '[@Admin]';
text += '<p class=""' id="item' + userData.uid + '"> + text + '</p>';
$('#item' + userData.uid).attr("data-user", userData.uid);
ref.push({text: text});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question