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 7733123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:54:25+00:00 2026-06-01T06:54:25+00:00

I have a text file (e.g. a Gutenberg book) I want to display in

  • 0

I have a text file (e.g. a Gutenberg book) I want to display in an HTML page dynamically. I know how to load the file using Javascript, but I’m not sure how to properly display it. Simple document.write-ing it is not good since it destroyes line breaks (and maybe other things?).

I can put the text inside TextArea and then it’ll look fine, but I want one more thing: To be able to color specific letters in the text in different colors (e.g. color the fifth “h” in blue and the seventh “h” in red). I don’t think TextArea can do it; I thought simply to wrap the letter by some div and use CSS.

So, how do I transform the text from the file to something that is HTML-friendly?

  • 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-06-01T06:54:26+00:00Added an answer on June 1, 2026 at 6:54 am

    You can use PRE tag for this, I have created a jsFiddle with an example – http://jsfiddle.net/X68Af/4/

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

Sidebar

Related Questions

I have text file with string which code page is 1250. I want to
I have a text file that I want to edit by rewriting it to
I have a text file and I would like to parse it using regular
I have text file with several thousands lines. I want to parse this file
I have text file which I want to erase in Python. How do I
I want to filter the data from a text file in unix. I have
I have a text file of 1000 words that I want to format an
i have text file and read it using stream reader, when my file is
I have text file which contains list of lonlat points. I want to send
Let's say you have a text file like this one: http://www.gutenberg.org/files/17921/17921-8.txt Does anyone has

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.