Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style> 
#myDIV {
  width: 150px;
  height: 100px;
  background-color: lightblue;
  border: 1px solid black;
}
</style>
</head>
<body>
<h1>Change overflow-wrap with JavaScript</h1>
<p>Click the "Try it" button to let the DIV element wrap words:</p>
<div id="myDIV">Thiscouldbeaninsainlylargeword</div>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
  document.getElementById("myDIV").style.overflowWrap = "break-word";
}
</script>
</body>
</html>