Simulate click on input in mobile

Simulate click on input in mobile

I'm trying to covert over some code to work in mobile browsers, Note: have jQuery Mobile Events in the page.

The html:
  1. <input type="file" id="importfile" style="display:none;"><button id="import" >&nbsp;Import</button>

The orig script:

  1. $("#import").click(function() {
  2.   document.getElementById("importfile").click();
  3. });

New script:

  1. $('#import').on('singletap', function() {
  2.   console.log('Import Button Hit'); // fires ok
  3.   console.log('Importfile: ' , $('#importfile')); // shows correct input element
  4.   $('#importfile').trigger('singletap');
  5. });

It's giving me the logs, but never simulates the click on #importfile.  What do I need to change?