Set the height and width of <div> to 500 pixels. - Javascript jQuery

Javascript examples for jQuery:Width Height

Description

Set the height and width of <div> to 500 pixels.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("div").height(500).width(500);
});//  w  w  w .j a v a 2  s.  c o  m
</script>
<style>
div {
    height: 100px;
    width: 300px;
    padding: 10px;
    margin: 3px;
    border: 1px solid blue;
    background-color: lightblue;
}
</style>
</head>
<body>

<div>I am a div.</div>

</body>
</html>

Related Tutorials