Underlining words in textarea

Posted on 2006-05-17
Last Modified: 2009-07-29
If I have a textarea that is built something like this:

<textarea name="testArea" id="testArea" cols=30 rows=5>This is my test textarea</textarea>

And I want to underline (or make red) a certain word in the textarea, is this possible?  If so, how would I do it?  I am trying to make my spellchecker be more user-friendly and I was thinking that if I could mark all the words I find misspelled in the textarea that might help.  Thanks in advance for your comments.
Question by:Caliguian
    LVL 10

    Assisted Solution

    try this

    <textarea name="testArea" id="testArea" cols=30 rows=5 style="text-decoration:underline">This is my test textarea</textarea>
    LVL 3

    Accepted Solution

    A simple textarea cannot display formatted text. So you cannot underline text or color specific words... You will need a rich text editor to do this. This is way more advanced than a simple textarea though, so you might want to consider if this is truly nessecairy...

    You can find a good and free rich text editor at:
    LVL 3

    Expert Comment

    True prakash, but in that case you underline the whole text and i don't think that is what is needed... You can also color the whole text in a default color, but it's not possible to give only some words a default style...
    LVL 10

    Expert Comment

    yes vincent :( . we must use a rich text editior.

    Author Comment

    Dang.  I was hoping single words could be decorated.  Thanks for the input guys.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
    This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
    In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now