0

fileuploadに入力タイプのファイルを使用する代わりに、入力のように通常のfileuploadを呼び出すクリック可能なdivを使用したいと思います。

instead of this
<input type="file"/> 

I want this
<div>Click to upload</div>
and paste the file path in the div
4

1 に答える 1

1

アイディア:

ユーザーがdivをクリックしたら、ファイル入力でclickイベントを呼び出し、変更されたら、divにhtmlを挿入します。

divで

 $('#magicdiv').click(function(){
 $('#leupload').click();
  });

アップロードファイル

$('#leupload').change(function(){
$('#magicdiv').html( $(this).val() );
});
于 2012-04-22T04:11:29.997 に答える