How to use the Elements module to make $form['element'] = array( '#type' => 'number' ); As Drupal 7, core field doesn't support HTML 5 form elements.

How can I use the Elements module from Form API to make the it works below?

$form['element'] = array(   '#type' =&gt; 'number' );
Have a quick look at the code of the elements module.

The number field is defined like this:

  $types['numberfield'] = array(
    '#input' =&gt; TRUE,
    '#step' =&gt; 1,
    '#process' =&gt; array('ajax_process_form'),
    '#element_validate' =&gt; array('elements_validate_number'),
    '#theme' =&gt; 'numberfield',
    '#theme_wrappers' =&gt; array('form_element'),
  );


So you should use '#type' =&gt; 'numberfield' instead.