$(selector).innerWidth()
<!DOCTYPE html>
<html>
<head>
<script src="/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
alert("Inner width of div is: " + $("div").innerWidth());
});
});
</script>
</head>
<body>
<div style="height:100px;width:500px;padding:10px;margin:3px;border:1px solid blue;background-color:lightpink;"></div><br>
<button>Click here to get the inner width of the div</button>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>The jQuery Example</title>
<script type="text/javascript" src="/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$("div").click(function () {
var color = $(this).css("background-color");
var width = $(this).innerWidth();
$("#result").html("Inner Width is <span>" + width + "</span>.");
$("#result").css({'color': color, 'background-color':'white'});
});
});
</script>
<style>
#div1{ margin:10px;padding:10px; border:2px solid #666; width:60px;}
#div2 { margin:15px;padding:15px; border:4px solid #666; width:60px;}
#div3 { margin:20px;padding:20px; border:6px solid #666; width:60px;}
#div4 { margin:25px;padding:25px; border:8px solid #666; width:60px;}
</style>
</head>
<body>
<p>Click on any square:</p>
<span id="result"> </span>
<div id="div1" style="background-color:orange;"></div>
<div id="div2" style="background-color:green;"></div>
<div id="div3" style="background-color:brown;"></div>
<div id="div4" style="background-color:violet;"></div>
</body>
</html>
Click on any square: