<a href="javascript:;" style="background: #8492af; color: #ffff; width: 100px; display: block; text-align: center; line-height: 40px; height: 40px; overflow: hidden;">营业执照.jpg <input type="file" name="file" class="fileBox" style=" height: 40px;margin-top: -40px; filter: alpha(opacity=0);opacity: 0;"> </a>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .labela{ position: relative; } #fileinp{ position: absolute; left: 0; top: 0; opacity: 0; } #btn{ margin-right: 5px; } #text{ color: red; } </style> <script src="js/jquery-1.11.1.min.js"></script> </head> <body> <label class="labela" for="fileinp"> <input type="button" id="btn" value="点我上传"><span id="text">请上传Word文档</span> <input type="file" id="fileinp"> </label> <script> $("#fileinp").change(function () { $("#text").html($("#fileinp").val()); }) </script> </body> </html>