jQuery:模擬<input type =“ file” />的單擊在Firefox中不起作用?我有一個看起來像這樣的網(wǎng)頁<html>
<head>
<title>File Upload Click Test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<body>
<div onclick="$('input[type=file]').click()" >CLICK SIMULATOR</div>
<input type="file"></input>
</body></html>我的目標(biāo)是讓div在文件輸入上引發(fā)一個click事件,這似乎完全符合我在IE和Chrome中的預(yù)期,但在Firefox中不起作用(當(dāng)您單擊Firefox時未打開文件瀏覽器)div)。有沒有辦法讓它在FF中工作?
jQuery:模擬<input type =“ file” />的單擊在Firefox中不起作用?
ITMISS
2019-09-26 10:10:15