dom.js
来自「这是《JavaScript学习源代码》一书的源代码」· JavaScript 代码 · 共 13 行
JS
13 行
// a function to demonstrate three ways to address a form component
function modify()
{
// address through element hierarchy
window.document.forms[0].elements[0].options[1].selected = true;
// address by id hierarchy
window.document.forms.f.box.checked = true;
// address directly by id
window.document.getElementById("txt").value = "Modified";
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?