<body>
<div style="border:1px solid #0000;height:50px;position:relative">
<input type="text" >
<input type="file" >
<button style="position:absolute;left:160px;top:0;z-index:0">浏览</button>
</div>

</body>
<script>
window.onload = function () {
// console.log(document.querySelectorAll('input'))
let file = document.querySelector("input[id='file']")
console.log(file, file.value)
let text = document.querySelector("input[type='text']")
file.addEventListener('change',function(){
text.value = file.value
})
}
</script>

相关文章:

  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2022-02-18
  • 2021-12-07
  • 2021-08-12
猜你喜欢
  • 2021-11-12
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-09-24
相关资源
相似解决方案