Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4101220
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:40:07+00:00 2026-05-20T20:40:07+00:00

I would like to have the visual representation of an HTML5 <textarea> tag indicate

  • 0

I would like to have the visual representation of an HTML5 <textarea> tag indicate when there are ‘hard’ newlines as opposed to wrapping. For example, given the text:

    Hello, world\n
    How are you, and this text
    wraps to a new line because
    it's too long.\n
    But this is a proper new line.

I would like to have some visual indication of the lines separated by newlines such as white-space:

    Hello world

    How are you, and this text
    wraps to a new line because
    it's too long.

    But this is a proper new line.

Inserting a visual character or text string in place of the newline such as ¶, could also work i.e.

    Hello world¶
    How are you, and this text
    wraps to a new line because
    it's too long.¶
    But this is a proper new line.

Ideally I’d like to be able to do this with CSS, but I’m not sure what the appropriate (if it even exists) mechanism would be for such a visual representation.

I’d prefer to not have to modify the contents of the textarea, if possible.

I’d also prefer to work with a “pure” textarea tag (as opposed to e.g. TinyMCE).

Thank you for reading, any thoughts and suggestions would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:40:08+00:00Added an answer on May 20, 2026 at 8:40 pm

    Live Demo

    <style type="text/css">
    #myform textarea {
        border: 1px solid #000;
        position: absolute;
    }
    #myform #source {
        background: transparent;
        z-index: 1;
    }
    #myform #mirror {
        color: rgba(0,0,0,0.5);
        z-index: -1;
    }
    </style>
    
    <script type="text/javascript">
    $("#source").keyup(function() {
        $("#mirror").val($("#source").val().replace(/\n/g,"¶\n"));
    });
    </script>
    
    <form id="myform">
        <textarea id="source" rows="10" cols="40"></textarea>
        <textarea id="mirror" rows="10" cols="40"></textarea>
    </form>
    

    Note: Tested on Firefox 3.6.x only. (IE will need some different CSS for opacity)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed Visual Studio 2012 RC. I would like to find any example
I have a Visual Studio 2008 C++ project where I would like to copy
I have a Visual Studio 2008 C++03 application where I would like to initialize
I have a Visual Studio 2008 C++03 project where I would like to verify
I have a Visual Studio 2008 C++ dll where I would like to accept
I have a Visual Studio 2008 C++03 application where I would like to have
Greetings, I would like to use EF4 but I only have Visual studio 2010
I have a Visual Studio 2008 solution, and I would like to include a real folder
I have a Visual Studio 2008 C++ application where I would like to replace
I have a Visual Studio 2008 C++ application where I would like to insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.