我希望html文件能够立即加载到文本区域,而无需用户单击按钮。我该怎么做?
您可以使用 onchange 在您的文件中:
onchange
document.getElementById("loadFile").onchange = function() { // ... })