标签:
<html> <head> <script type="text/javascript"> function performClick(elemId) { var elem = document.getElementById(elemId); if(elem && document.createEvent) { // sanity check var evt = document.createEvent("MouseEvents"); evt.initEvent("click", true, false); elem.dispatchEvent(evt); } } </script> </head> <body> <a href="#" onclick="performClick(‘theFile‘);">Open file dialog</a> <input type="file" id="theFile" /> </body> </html>
标签:
原文地址:http://www.cnblogs.com/yydaddy/p/4195910.html