drupal jquery mobile datepicker cannot select year I'm using drupal 7 with jquery.mobile-1.4.5.  

I had created a form with date field, using Inline Datepicker

  $form['body']['dob'] = array( 
    '#type' =&gt; 'textfield',
    '#title' =&gt; 'Date of Birth',     
    '#attributes' =&gt; array('data-role'=&gt;'date', 'id'=&gt;'dob'),
  );


The Inline Datepicker is showing exactly like the demo in http://demos.jquerymobile.com/1.4.1/datepicker/

However, I would like to have a inline datepicker, with a dropdown menu for user to select year in calendar.
Eg: https://jqueryui.com/datepicker/#dropdown-month-year

I had tried adding in below function but it doesn't work.

$(function() {
    $( "#dob" ).datepicker({
      changeMonth: true,
      changeYear: true
    });
  });


Is there any way I can allow user select year in the inline datepicker?
You can use Date module which has several options regarding to your requirement. You can use date functionalities in your custom form. 

For example,

$form['body']['dob'] = array( 
  '#type' =&gt; 'date',
  '#title' =&gt; 'Date of Birth', 
);


will have options to select date, month and year.

If #type =&gt; 'date_popup', it  will popup with calendar which allows user to select date.

Check this link for more info date example