HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ border: 1px solid black; width: 150px; height: 100px; margin-bottom: 10px; } </style> </head> <body> <h1>CSS word-wrap Property</h1> <div> This text will break to next line WhenWordWrapBreakWordIsUsed. </div> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("div")[0]; function myFunction(){ x.style.wordWrap = "break-word"; } </script> <p><strong>Note</strong>: Click on the button to change the 'word-wrap' from normal to break-word.</p> </body> </html>
OUTPUT
×

Save as Private