Edit This Code:
See Result »
<!DOCTYPE html> <html> <head> <style> #myDIV { border: 1px solid black; background-color: lightblue; width: 200px; height: 210px; white-space: nowrap; } </style> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?73c27e26f610eb3c9f3feb0c75b03925"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </head> <body> <p>Click the "Try it" button to change the overflowX property of the DIV element:</p> <button onclick="myFunction()">Try it</button> <div id="myDIV"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit,<br> sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.<br> Ut wisi enim ad minim veniam,<br> quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </div> <script> function myFunction() { document.getElementById("myDIV").style.overflowX = "scroll"; } </script> </body> </html>
Result: