Jump to: navigation, search

JQuery Width and Height

From w3cyberlearnings

Contents

jQuery assign height and width

The $.height(val) and $.width(val) use to assign height and width respective to the HTML elements.

Syntax

$("div").height("490");
$("div").width("490");

Example TRY-IT

<!DOCTYPE html>
<html>
	<head>
		<title>height and width</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="jquery.min.js">
		</script>
		<script language="javascript">
			$(document).ready(function(){
				$("div").height("490");
				$("div").width("490");
				$("div").css("background-color","grey");
			});
		</script>
	</head>
	<body>
      <div>my Content</div>
	</body>
</html>

Related Links


Navigation
Web
SQL
MISC
References