方法1:
让按钮变成好看的图片
<table border="0" cellspacing="0" cellpadding="0" class="px12gray_none_6e">
<tbody>
<tr>
<td><input type="text" name="f_file" class="input_gray" size="20" disabled><input name="elmFile" type="file" style="position:absolute;filter:alpha(opacity=0); width: 20px; cursor: pointer;" id="elmFile" οnchange="this.form.f_file.value=this.value" hidefocus></td>
<td width="70" align="center"><img src="newsub_124.gif" width="47" height="18" style="cursor: pointer;" alt="浏览"></td>
<td valign="bottom">(最大可能上传200K)</td>
</tr>
</tbody>
</table>
方法2:
改变按钮文字和颜色
<html>
<head>
<title>File Upload Example</title>
<script language="JavaScript" type="text/javascript">
function HandleFileButtonClick()
{
document.frmUpload.myFile.click();
document.frmUpload.txtFakeText.value = document.frmUpload.myFile.value;
}
</script>
</head>
<body>
<form name="frmUpload">
<input type="file" name="myFile" style="display: none">
<input type="text" name="txtFakeText" readonly="true">
<input type="button" οnclick="HandleFileButtonClick();" value="上传文件" style="background:red">
</form>
</body>
</html>