⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 17-6.html

📁 js 全的样例代码,比较适合大家学习和交流
💻 HTML
字号:
<script>// This function takes a node n, replaces it in the tree with an Element node// that represents an html <b> tag, and then makes the original node the// child of the new <b> element.function embolden(node) {    var bold = document.createElement("b"); // Create a new <b> Element    var parent = node.parentNode;           // Get the parent of node    parent.replaceChild(bold, node);        // Replace node with the <b> tag    bold.appendChild(node);                 // Make node a child of the <b> tag}</SCRIPT><!-- A couple of sample paragraphs --><p id="p1">This <i>is</i> paragraph #1.</p><p id="p2">This <i>is</i> paragraph #2.</p><!-- A button that invokes the embolden() function on the first paragraph --><button onclick="embolden(document.getElementById('p1'));">Embolden</button>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -