---
title: "删除file控件的内容"
author: "harbey"
date: "2009-05-15T17:24:25Z"
tags: []
slug: "file"
draft: false
lastmod: "2009-05-15T17:25:54Z"
id: 387580
url: "https://harbey.iteye.com/blog/387580"
---

删除file控件的内容：

```java
<s:file id="channel" name="channel" value="文件上传"></s:file>
<input type="button" value="清空" onclick="channel.select();document.execCommand('delete')">
```

其中onclick="channel.select();document.execCommand('delete')"中的channel为对应file控件的id；