I'm in a sticky situation. I'm trying to make an image an upload button, but I cannot change that image at all... however, when you click the image, I have it calling a JS function I can put anything into.
How can I launch an browser upload though this function alone? Normally I would just make the image an input, but like I said, in this case I cannot do that.
Does anyone have an example they could share?
Here's my function (which is called onclick of the image):
function fnImport(elem){
var $input;
$input = $input || $("<input type='file'>");
$('#Import').append($input);
$input.click();
$input.hide();
}
However, when I run it, on the first click it adds the button, then on second it acts as an upload (and doesn't hide in either).
In addition, I'm getting a strange as well in my console?