document.getElementById('buttonid').addEventListener('click', openDialog); function openDialog() { document.getElementById('fileid').click(); } <input id='fileid' type='file' hidden/> <input id='buttonid' type='button' value='Upload MB' />