Saved X
Google login
SignUp with Email
X

Jquery set width

theindreshverma ( Edited  Sep 29, 11:50 pm )
Login

Jquery css() method

<html>
<head>
    <title>Jquery set width</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>

<h1>Jquery set width</h1>

<div id="d" style="border: 1px solid #ccc;height: 200px"></div>
<br>
<br>
<button id="b">Set Width</button>

<script>
$('#b').click(function() {
   $('#d').css('width', '50%');
});
</script>

</body>
</html>

Sourcecode Tags

More Sourcecodes

More Sourcecodes