The input Tag file type removes the "No file selected" option for different browsers. inputfile
The previous style, this "unselected file" would like to remove it?
The running result of this Code removes the "unselected file"
<! 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> untitled document </title>
<Style>
# File {width: 226px; height: 25px; position: relative ;}
# Filetxt {}
# Filebtn {position: absolute; right: 0px ;}
# Upfile {width: 70px; position: absolute; right: 0px; top: 0px; opacity: 0 ;}
</Style>
<Script src = "http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"> </script>
</Head>
<Body>
<Div id = "file">
<Input id = "filetxt" type = "text" value = "file not selected"/>
<Input id = "filebtn" type = "button" value = "SELECT"/>
<Input id = 'upfile' type = "file"/>
</Div>
<Script>
$ (Function (){
$ ('# Upfile'). change (function (){
$ ('# Filetxt'). val ($ ('# upfile'). val ());
});
});
</Script>
</Body>
</Html>
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.