JavaScript Example (Program)
Learn Details

1. what is window width ?

Ans : किसी browser के width को window width कहते हैं। window width दो प्रकार के होते हैं ।

  • Outer width :- browser के outer (including all elements like toolbars/scrollbars) width को outer width कहते हैं।
  • Inner width :- browser के inner (rejecting all elements like toolbars/scrollbars) width को inner width कहते हैं।

Syntax

for outer width

window.outerWidth

for inner width

window.innerWidth

2. what is window height ?

Ans : किसी browser के height को window height कहते हैं। window height दो प्रकार के होते हैं।

  • Outer height :- browser के outer (including all elements like toolbars/scrollbars) height को outer height कहते हैं।
  • Inner height :- browser के inner (rejecting all elements like toolbars/scrollbars) height को inner height कहते हैं।

Syntax

for outer Height

window.outerHeight

for inner Height

window.innerHeight

Example

HTML Code


   <html>	
	<!--head section-->
   <head>
      <title>Official Website Teach Coders</title>
		  <meta name="description" content="Teach Coders" />
		  <meta name="keywords" content="Teach Coders" />
   </head>

   <body>


   </body>
</html>
   
  
----------------------------------------------------------
 EXAMPLE 1 : windowWidth & windowHeight
----------------------------------------------------------
 <script>
 var a = window.outerWidth;
 console.log("outer Width :" + a);

 var b = window.innerWidth;
 console.log("inner Width :" + b);

  var c = window.outerHeight;
 console.log("outer Height :" + c);

  var d = window.innerHeight;
 console.log("inner Height :" + d);
</script>

</script>



 
 
  
  

Css Code


<style>
     

</style>