Edit This Code:
See Result »
<!DOCTYPE html> <html> <head> <style> #myDIV { width: 500px; height: 500px; background-color: lightblue; } </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> <div id="myDIV"> This is my DIV element. </div> <p>Click the "Try it" button to change the bottom margin of the DIV element:</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { document.getElementById("myDIV").style.marginBottom = "100px"; } </script> </body> </html>
Result: