jQuery outerWidth Method
jQuery outerWidth Method : is used to get the width of selected element including the padding and border both. It returns width padding and border ie. outer width = border width + padding + with of container.
We are going to explain this method with example and demo.
jQuery outerWidth Method Syntax
jQuery Syntax for outer with –
$(selector).outerWidth();
jQuery outerWidth Method Example
Here is example for outer with of the container –
<script type="text/javascript"> $(document).ready(function(){ $( "#widthExample" ).on( "click", function(event) { var x = $("#myDiv").outerWidth(); $("#myDiv > p").html("Outer Width = "+x+"px"); }); }); </script> |
If you run the above example it will produce the following output-
Advertisements
Add Comment
📖 Read More
- 1. jQuery outerHeight Method
- 2. jQuery Ajax Basic Example
- 3. jQuery Ajax load Method
- 4. jQuery Ajax get Method
- 5. jQuery Ajax post Method