0

I have two element <input> and <a> below:

<input type="file" accept=".jpg, .png, .gif" class="inputUpload" id="fileUpload" onchange="changeAvatar()" onclick="selectFile()" />

<a onclick="selectImage()" href="javascript:void(0);" class="pull-right">Select image</a>

How to call event onchange and onclick from function:

function selectImage(){ };
M.Peter
  • 75
  • 1
  • 10

1 Answers1

0

You can try that if You used jQuery:

function selectImage() { $("#fileUpload").trigger("tap"); }

or

function selectImage() { $("#fileUpload").trigger("click"); }