Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
- <script>
- $(document).ready(function(){
- $("button").click(function(){
- alert("Width of div: " + $("#a").width());
- });
- });
- </script>
- </head>
- <body>
- <div id="a" style="width:1000px;height:500px;">
- <div style="height:100px;width:300px;padding:10px;margin:3px;border:1px solid blue;background-color:lightblue;">
- </div>
- </div>
- <br>
- <button>Display the width of div</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement