首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >javascript当中insertBefore的用法

javascript当中insertBefore的用法

作者头像
马克java社区
修改于 2021-01-22 03:04:14
修改于 2021-01-22 03:04:14
4890
举报
文章被收录于专栏:java大数据java大数据

例 1.3(insertBeforeIEFF.html) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head>     <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </HEAD> <BODY> <div id="contain">     <p id="content">1111</p>     <div id="msg">         msg         <div>test</div>     </div>     <p id="content1">222</p>     <p id="aaa">aaaaaaaa</p> </div> end <div id="insertedNode">insertedNode</div> <script> var insertedNode = document.getElementById("insertedNode"); var aaa = document.getElementById("aaa"); var test = document.getElementById("contain"); /* 马克-to-win: first comment out the following statement, see the effect, then uncomment out the following statement, see the effect again. Node.insertBefore() (Method) This method inserts a child element into the collection at the indicated position.(qixy: here "contain" is a collecton.) 返回值:Property/method value type: Node object  JavaScript syntax: - myNode.insertBefore(aNode1, aNode2)  Argument list: aNode1 The node to be inserted  aNode2 The node indicating the insertion point

更多请见:https://blog.csdn.net/qq_44594371/article/details/103063631

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档