Make div into full screen mode or expand to screen width on click of button using CSS and JQuery

There may be a scenario there you want to expand the div or panel into full screen mode or to particular width. This can be achieved via CSS and Jquery toggleClass method

Code :
<html>

 <head>
 	<title>Make div into full screen mode or expand to screen width on click of button using CSS and JQuery</title>
 	<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>

 	<style type="text/css">
 		.fullscreen {
 			z-index: 9999;
 			width: 100%;
 			height: 100%;
 			position: fixed;
 			top: 0;
 			overflow: auto;
 		}

 		.fullscreen body {
 			overflow: hidden;
 		}

 		#divExpand {
 			background-color: yellow;
 		}
 	 </style>

 	<script language="javascript">
 		$(document).ready(function() {
 			$('#btnExpand').on('click', function() {
 				$("#divExpand").toggleClass('fullscreen');
 			});
 		});
 	</script>

 </head>

 <body>
 	<div id="divExpand">
 		Expand this div
 		<input type="button" value="Click to ExpandMinimize" id="btnExpand" />
 	</div>
 	Other Content goes here
 </body>

 </html>