直接给出 我笔记中的代码 如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>清空 input type="file" 里面已经选择的路径</title>
</head>
<body>
<form action="#" method="post">
<input name="filePath" type="file" />
<input type="button" value="清空" οnclick="fielPath.createTextRange().execCommand("delete")" />
</form>
</body>
</html>
Over !!!