11 Develop JavaScript program with HTML to create Pull-Down menu with three option[Google, MSBTE, Yahoo].Once the user will select the one of the options then user will redirected to that site.

Program:

<!DOCTYPE html>

<html>

    <head>

        <script type='text/JavaScript'>

            function getPage(Choice)

            {

                Page = Choice.options[Choice.selectedIndex].value;

                if(Page != "")

                {

                    window.location = Page;

                }

            }

        </script>

    </head>

    <body>

        <form action="" name="f">

            Select your favourite website:

            <select name="MenuChoice" onchange="getPage(this)">

                <option value="https://www.google.com/"> Google </option>

                <option value="https://www.msbte.org.in/"> MSBTE </option>

                <option value="https://www.yahoo.com/"> Yahoo </option>

            </select>

        </form>

    </body>

</html>


Output:
Pull Down Menu JavaScript

Previous
Next Post »