下面是01.html文档的内容:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p id="AX"></p>
<script>
f("AX");
function f(x){
let a=document.createElement("input");
a.setAttribute("type","file");
a.setAttribute("onchange","g(x)");
document.body.appendChild(a);
}
function g(x){
document.getElementById(x).innerHTML="已上传";
}
</script>
</body>
</html>
运行01.html,上传文件,我希望它出现“已上传”的字样,然而并没有出现。
如何才能让onchange对应的函数中使用原函数的参数?