06.js
来自「进行ajax开发sdsd s d sd s」· JavaScript 代码 · 共 18 行
JS
18 行
// This function recursively looks at Node n and its descendants, // converting all Text node data to uppercasefunction upcase(n) { if (n.nodeType == 3 /*Node.TEXT_NODE*/) { // If the node is a Text node, create a new Text node that // holds the uppercase version of the node's text, and use the // replaceChild() method of the parent node to replace the // original node with the new uppercase node. n.data = n.data.toUpperCase(); } else { // If the node is not a Text node, loop through its children // and recursively call this function on each child. var kids = n.childNodes; for(var i = 0; i < kids.length; i++) upcase(kids[i]); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?