Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To retain line feeds in scanner input within an HTML element, you can use the HTML tag <pre> (preformatted text) to preserve the original formatting of the input text.

Here's an example:

<pre>
  Enter your input:
  This is line one.
  This is line two.
  And this is line three.
</pre>

This will display the input exactly as entered, with line breaks preserved:

Enter your input:
This is line one.
This is line two.
And this is line three.