HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ width:150px; height:50px; font-size:17px; white-space:nowrap; border:1px solid #8c8c8c; margin:10px; } </style> </head> <body> <div id="point"> This div contains lots of text, but the height of this div is 50px, whereas, width of this div is 150px. </div> <button onclick="myFunction()">Click Me</button> <script> function myFunction(){ var x = document.getElementById("point"); x.style.overflowX = "scroll"; } </script> <p><strong>Note</strong>: Click on the button to change the div from overflow-x visible to scroll.</p> </body> </html>
OUTPUT
×

Save as Private