write a program to Input age from the function and printing the message from the function also

 Name of Program - Input age from the function and printing the message from the function also

Code Input -

<html lang="en">

<head>

    <script>

        function validate(){

            var age=parseInt(prompt("Enter age"));

            var ans="not eigible";

            if(age>=18){

                ans="eligible";

            }

            document.write("You are <b>"+ans+"</b> for Vote");

        }

    </script>

</head>

<body>

    <script>

        validate();

    </script>

</body>

</html>


Code View -

Input Age -



Show Result




No comments

Plz.... Don't enter any spam message