not render html to client with websockets

I use nodejs v0.10.12 and play around with websockets. On server side, I have a code like

//the http server
var server = http.createServer(function(request, response) {
    console.log((new Date()) + ' Received request for ' + request.url);
    response.writeHead(200, {'Content-Type': 'text/html'});
    response.end(clientHtml);
});
server.listen(8000, function() {
    console.log((new Date()) + ' Server is listening on port 8000');
})

//the websockets server
var wsServer = new WebSocketServer({
    httpServer: server,
    autoAcceptConnections: false
});

//connections, getting data from client , etc, etc

//try to send data to client
 connection.send('<b>Name</b></br>'+
result.row[i].p_name+
'</br></br><b>Description</b></br><textarea rows="20" cols="60">'
+result.rows[i].p_descr+
'</textarea>');

I want to send the data included in the connection.send from server to client through websockets. The problem is that, on the client, the html tags also render, on the browser I get

<b>Name</b></br>testpoint5</br></br><b>Description</b></br><textarearows="20"cols="60">testpoint5</textarea>

I searched for "html tags through websockets" and such, but nothing usefull...

Any suggestions? How to make the html tags "work" on the client, instead of just rendering?

Thanks

are you later trying to insert that data into the DOM?

in that case you need to escape your tags. What I mean is < should become &lt; and > should become &gt;

There are other characters that you also need to escape. Look up 'escaping html entities' on google.

You should be doing this on the server-side:

connection.send("&lt;b&gt;Name&lt;/b&gt;&lt;/br&gt;"+result.rows[i].p_name+"&lt;/br&gt;&lt;/br&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/br&gt;&lt;textarearows="20"cols="60"&gt;"+result.rows[i].p_descr+"&lt;/textarea&gt;")