简单记录一下
效果图:
代码:
1 <input class="aload" type=‘button‘ value=‘上传附件‘ onClick=‘javascript:$("#hiddenFile").click();‘ /> 2 <input id=‘showFileName‘ type=‘text‘ readonly style="border: none;"/> 3 <input id=‘hiddenFile‘ type=‘file‘ style="display:none" onchange=‘ophiddenFile();‘ />
js code:
1 function ophiddenFile() { 2 var dd = $("#hiddenFile").val().split("\\"); 3 $("#showFileName").val(dd[dd.length - 1]); 4 }
原文地址:https://www.cnblogs.com/lstory/p/8425959.html
时间: 2024-10-25 13:49:49