html input file,html input type=file是否有值
html input file,html input type=file是否有值详细介绍
body {
font-size: 14px;
}
input {
vertical-align: middle;
margin: 0;
padding: 0
}
.file_style {
position: relative;
width: 340px
}
.text_style {
height: 22px;
border: 1px solid #cdcdcd;
width: 180px;
}
.button_style {
background-color: #FFF;
border: 1px solid #CDCDCD;
height: 24px;
width: 70px;
}
.file_item {
position: absolute;
top: 0;
right: 80px;
height: 24px;
filter: alpha(opacity : 0);
opacity: 0;
width: 260px
}
<input
type="button" class="button_style" value="浏览..." />
<input type="file"
name="fileField" class="file_item" id="fileField" size="28"
onchange="document.getElementById('textfield').value=this.value" />
</input