<html>
<head>
<script>
function displayResult()
{
document.getElementById("div1").style.whiteSpace="pre";
}
</script>
</head>
<body>
<div id="div1">
This is so me text. This is some tex t. This is some
text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
</div>
<br>
<button type="button" onclick="displayResult()">Preserve whitespace and line breaks</button>
</body>
</html>