Window.value for global variable is not working

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1.0">


<script type="text/javascript">

<input type="button" value="click" onclick="me()"/>

    document.write("i am no bpody");

    function me(){

        document.write("i am on");



    function area(){

        var Area=5*5;







> Preformatted text

It is the concept of Global and Local Scope .Your variable window.value is in the block/ local scope of me(), you cannot get it from outside.

Any inner function can access outer value but from outside you cannot access inner value of functions.

Two ways to get your value:
you can access by placing your window.value in global scope or
you can pass your inner value window.value to any global variable to access inside/outside of function.