underline a part of text in Textarea
10,530
Solution 1
You can use a contenteditable
div.
<div contenteditable="true">I am saying <span>Hello</span></div>
Solution 2
You can't do that on textarea, You'll need some WYSIWYG if you need style on it. Or you can fake user by adding div above of the textarea, and hide the textarea it self.
Author by
Naruto
Updated on June 04, 2022Comments
-
Naruto almost 2 years
is it possible to underline a portion of text in control.
I did like this in jquery, but no underline is appearing. any sample code examples?
<textarea rows = "3" cols = "50" id = "TestName" ></textarea>
Jquery
var dvHTML = '' dvHTML = '<span style=text-decoration: underline;>' + "Hello world" + '</span>'; $("#TestName").html(dvHTML);
Output i'm getting as only Hello world, tags are not getting recognized
-
Naruto about 10 yearsThanks, are there any sample example?
-
Naruto about 10 yearsIf so, then how does sharepoint people picker control works?, how they have implemented that, it does underlining when it recognizes contact
-
BeNdErR about 10 yearsthis will underline everything inside the textarea
-
Naruto about 10 yearsI want a specific portion of the line to be underlined,
-
Naruto about 10 yearsin this case, if my text size is more then div size then it will come out of the border right?, if i hit enter it wont expand like text area na>
-
xdazz about 10 years@LLL You could do some css trick to deal with this, check the demo again i updated it.
-
Nathan B about 5 years@Iqbal Fauzi, how can we create the div about the textarea? Is there such an example somewhere?