HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> #point{ padding:25px 0; border:1px solid #8c8c8c; } </style> </head> <body> <div id="point"> Width of this container (div) is auto. </div> <button onclick="myFunction()">Click Me</button> <script> function myFunction(){ var x = document.getElementById("point"); x.style.width="300px"; } </script> <p><strong>Note</strong>: Click on the button to set the width of this div to "300px".</p> </body> </html>
OUTPUT
×

Save as Private