1<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
2<form>
3 <label for="file-upload" class="custom-file-upload">
4 <i class="fa fa-cloud-upload"></i> Upload Image
5 </label>
6 <input id="file-upload" name='upload_cont_img' type="file" style="display:none;">
7</form>
1.custom-file-upload {
2 border: 1px solid #ccc;
3 display: inline-block;
4 padding: 6px 12px;
5 cursor: pointer;
6}
1<input id='fileid' type='file' hidden/>
2<input id='buttonid' type='button' value='Upload MB' />
1document.getElementById('buttonid').addEventListener('click', openDialog);
2
3function openDialog() {
4 document.getElementById('fileid').click();
5}