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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:58:26+00:00 2026-06-05T19:58:26+00:00

I hope the title explains what I’d like to achieve. If not, please read

  • 0

I hope the title explains what I’d like to achieve. If not, please read on!

I am currently coding a Lorem Ipsum generator (as a learning experience, though I may have it on my site for S&G’s)

So far, I’ve managed to get the code to output a random sentence from a list, into the text box. I’ve also created a generator for creating Lorem Ipsum bullet lists.
Whenever someone generates some text via the tool, I’d like to have one box with the formatted text (paragraphes, bulleted, etc) and then another box with the raw HTML code, so designers can just copy and paste the code straight into their coding program. So far, I’ve sorted out the formatted text box, but I’m having issues with the raw HTML.

This is what I’ve got so far:

[Obviously there’s a var listArray at the beginning, but I won’t bother adding that.]

var randomList = listArray[(Math.floor(Math.random() *listArray.length))]

document.getElementById("textarea").innerHTML = "<li>" + (randomList) + "</li>" + "<li>" + (randomList) + "</li>" + "<li>" + (randomList) + "</li>";
document.getElementById("textarea-code").innerHTML = "<li>" + randomList + "</li>" + "<li>" + randomList + "</li>" + "<li>" + randomList + "</li>";}

The second innerHTML line is just a copy of the first, and is the line I want to work on.

How do I get that second line to output:

<li> Line 1 </li>
<li>li Line 2 </li>

into the HTML text box, instead of putting the list items into a bulleted point?

  • 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-05T19:58:29+00:00Added an answer on June 5, 2026 at 7:58 pm

    I worked it out! 😀

    For those of you who are interested, I used ASCII codes for each of the characters required to make up the <, /, and >.

    For example: <li> is

    &#60;li&#62;
    

    Hope that helps someone else!

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

Sidebar

Related Questions

I hope the title is clear, please read further and I will explain what
I hope the title and following text are clear, I'm not very familiar with
I hope the title is not too confusing. I am trying to make folders
I hope the title doesn't sound too subjective; I absolutely do not mean to
I hope my title is not misleading, but what I'm looking for is a
I hope the title is not mis-leading. I am trying to implement onRetainNonConfigurationInstance() of
the title pretty much explains it. Please note that this is a WebKit-specific issue
Hope the title is not that confusing - honestly said I had no idea
I'm not sure if the question title really explains what I want to do,
I hope my title does justice for the question. Please consider the following block

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.