I wanted to get the age of a person from his date of birth. I have a HTML code where I'm using a datepicker for dob, when I give the date-of-birth it show automatically show the age without giving submit. Please help me in finding a solution for this.

```
<html>
    <head>
        <title>
            DOB calculations
        </title>
        <link rel='stylesheet' type='text/css' href='jquery-ui.css' />
        <script type='text/javascript' src='jquery.min.js'>
        </script>
        <script type='text/javascript' src='jquery-ui.min.js'>
        </script>
        <script type='text/javascript' src='jquery.js'>
        </script>
        <script type='text/javascript' src='jquery-ui-custom.js'>
        </script>
        <script type='text/javascript' src='jquery.ui.datepicker.js'>
        </script>
        <script type="text/javascript">
            $(function() {

                $('#datepicker').datepicker({
                    changeMonth: true,
                    changeYear: true,
                    dateFormat: 'mm/dd/yy',
                    //firstDay: 1,
                    onSelect: function(dateText, inst) {
                        dateText.split('/');
                        Bdate = new Date(dateText[2], dateText[0] - 1, dateText[1]);
                        BDateArr = ('' + Bdate).split(' ');
                        //document.getElementById('DOW').value = BDateArr[0]; 
                        Cdate = new Date;
                        CDateArr = ('' + Cdate).split(" ");
                        Age = CDateArr[3] - BDateArr[3];
                        document.getElementById('AGE').value = Age;
                        // DOBcalc(dateText); 
                        //DOBcalc(); 
                    }
                })

            });
        </script>
    </head>

    <body>
        <form>
            DOB (mm/dd/yyyy):
            <input type="text" id="datepicker" value=''>
            Age:
            <input id="AGE" type="text" value="">
        </form>
    </body>
</html>

```