Search code examples
javascripthtmlcsstext

Display multiple lines (<p> tags) as a paragraph


I want to display multiple lines for example:

  1. This is first sentence.
  2. This is second sentence.
  3. This is third sentence.

These three sentences need to displayed as -

This is first sentence. This is second
sentence. This is third sentence

Sample html for this could be

<p id="line-1"></p>
<p id="line-2"></p>
<p id="line-3"></p>

The use case is I need to track and save changes done in each sentence and save them seperately.

Any help appreciated.


Solution

  • You can try this

    <body>
        <p>
            <span>This is first sentence. This is second
            sentence. This is third sentence</span>
        </p>
    </body>