<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
div{
padding:10px;
border:1px solid #000;
font-size:17px;
width:180px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<h1>CSS white-space Property</h1>
<div>
This is some text. This is some text. This is some text.
</div>
<button onclick="myFunction()">Click Me</button>
<script>
var x = document.getElementsByTagName("div")[0];
function myFunction(){
x.style.whiteSpace = "nowrap";
}
</script>
<p><strong>Note</strong>: Click on the button to change the 'white-space' from normal to nowrap.</p> </body>
</html>