Copy codeThe Code is as follows:
<Body>
<Input type = file id = "j" onchange = "getValue ();" style = "-moz-opacity: 0; filter: alpha (opacity = 0); opacity: 0; position: absolute; left: 166px; "/>
<Input id = "ye" style = "color: green; border: 1px solid green; width: 300px;"/>
<Input type = "button" value = "File" style = "border: 1px solid green; width: 80px;"/>
</Body>
<Script language = "javascript">
Function getValue (){
Document. getElementById ('Ye '). value = document. getElementById ('J'). value;
}
</Script>
Ideas:
1. Make the stubborn file field <input type = file/> transparent: style = "-moz-opacity: 0; filter: alpha (opacity = 0); opacity: 0;"
2. Use a text box and button to replace the appearance of the file.
3. Place the Browse button of the file domain above the button we wrote.
4. When js is used to get the value of the file field changed, that is, the obtained file path is assigned to the value of the text box, so that it is OK.
I'm just experimenting with simple styles. In fact, they can be further beautified;
This advantage: It only simulates the appearance of the file domain. In fact, the file domain file function is very convenient.