insertAdjacentHTML("beforeEnd", html的含义和用法


document.getElementById("nim")为:获得名称为nim的层。
insertAdjacentHTML("beforeEnd", html)为:
nim层在其后追加插入内容为< INPUT type="file" size="50" NAME="File"> 的html格式信息。

向下面的例子,可以拷贝到网页中试试:
<script>
   function addFile()
   {
       var str = '<INPUT type="file" size="50" NAME="File">'
      var nim = document.getElementById("nim")

  nim.insertAdjacentHTML("beforeEnd", html)

   }
  </script> 
<div id="nim">
1234567
</div>dfdfdfdf
<a href="javascript:addFile()">df</a>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2026 CODEPRJ.COM