Skip to content Skip to sidebar Skip to footer

Making Specific Text In Textarea Bold

I am making an chatbox in which for displaying chat history I used textarea which is readonly.... what I want is to make the starting text 'Me: ' Bold document.getElementById(messa

Solution 1:

It's not possible to format part of the text in a textarea. Instead place the text in a <div>.

<div id="messages" style="white-space: pre-wrap"></div>

With jQuery:

$('#messages').append("<div><b>Me:</b>" + message1 + "</div>")

Post a Comment for "Making Specific Text In Textarea Bold"