上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 44 下一页
摘要: parentNode.children(非标准); parentNode.children是一个只读属性,返回所有的子元素节点。 它只返回子元素节点,其余节点不返回(重点掌握) 虽然children是一个非标准,但是得到了各个浏览器的支持,因此我们可以放心使用 DOM提供的获取 (API)获取 <b 阅读全文
posted @ 2022-04-18 11:19 罗砂 阅读(51) 评论(0) 推荐(0)
摘要: <style> * { padding: 0; margin: 0; } .box { width: 500px; height: 200px; border: 1px solid #ccc; margin: 50px auto; overflow: hidden; } ul { width: 60 阅读全文
posted @ 2022-04-18 11:18 罗砂 阅读(37) 评论(0) 推荐(0)
摘要: <body> <div class="box"> <span class="erweima">**</span> </div> </body> <script> // 1.父节点 parentNode let erweima = document.querySelector(".erweima"); 阅读全文
posted @ 2022-04-18 11:18 罗砂 阅读(50) 评论(0) 推荐(0)
摘要: 1.获取 属性值 element ?属性 获取属性值 element.getAttribute('属性') 区别: element.属性 获取内置属性值(元素本身自带属性) element.getAttribute('属性');主要获得自定义的属性(标准)我们程序员自定义的属性 <body> <di 阅读全文
posted @ 2022-04-18 11:17 罗砂 阅读(411) 评论(0) 推荐(0)
摘要: <style> * { margin: 0; padding: 0; } table { width: 500px; position: relative; margin: 100px auto; border-collapse: collapse; border: 1px solid #d7d7d 阅读全文
posted @ 2022-04-18 11:16 罗砂 阅读(147) 评论(0) 推荐(0)
摘要: <body> <button>按钮1</button> <button>按钮2</button> <button>按钮3</button> <button>按钮4</button> <button>按钮5</button> </body> <script> // 获取所有按钮元素 let btns 阅读全文
posted @ 2022-04-18 11:15 罗砂 阅读(38) 评论(0) 推荐(0)
摘要: <style> * { margin: 0; padding: 0; box-sizing: border-box; } li { list-style: none; } img { border: 0px; vertical-align: middle; width: 192px; } div { 阅读全文
posted @ 2022-04-18 11:15 罗砂 阅读(36) 评论(0) 推荐(0)
摘要: <style> input { color: #777777; } </style> </head> <body> <input type="text" value="手机" /> </body> <script> let ipt = document.querySelector("input"); 阅读全文
posted @ 2022-04-18 11:14 罗砂 阅读(66) 评论(0) 推荐(0)
摘要: <style type="text/css"> #box { width: 250px; margin: 100px auto; } #box li { width: 24px; height: 24px; float: left; margin: 10px; background-color: p 阅读全文
posted @ 2022-04-18 11:13 罗砂 阅读(38) 评论(0) 推荐(0)
摘要: <style> div { width: 50px; height: 50px; background-color: aquamarine; } </style> </head> <body> <div>1</div> </body> <script> let dv = document.query 阅读全文
posted @ 2022-04-18 11:12 罗砂 阅读(21) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 44 下一页