<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
div{
background: #fc0;
width: 100px;
height: 100px;
padding: 10px;
border: 10px solid red;
margin: 10px;
}
</style>
<script src="js/jquery-1.12.4.min.js"></script>
<script>
$(function(){
alert($('div').width()); //width
alert($('div').innerWidth()); //width+padding
alert($('div').outerWidth()); //width+padding+border
alert($('div').outerWidth(true)); //width+padding+border+margin
})
</script>
</head>
<body>
<div></div>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
div{
background: #fc0;
width: 100px;
height: 100px;
padding: 10px;
border: 10px solid red;
margin: 10px;
}
</style>
<script src="js/jquery-1.12.4.min.js"></script>
<script>
$(function(){
alert($('div').width()); //width
alert($('div').innerWidth()); //width+padding
alert($('div').outerWidth()); //width+padding+border
alert($('div').outerWidth(true)); //width+padding+border+margin
})
</script>
</head>
<body>
<div></div>
</body>
</html>