# How to get the width of a div element using jQuery?

To get the width of a div element, use the width() method in jQuery.

## Example

You can try to run the following code to get the width of a div element using jQuery:

Live Demo

<!DOCTYPE html>
<html>
<script>
$(document).ready(function(){$("button").click(function(){
alert("Width of div element: " + \$("div").width());
});
});
</script>
</html>