当前位置:网站首页>DOM object in JS
DOM object in JS
2022-06-27 17:36:00 【aqzengkuasheng】
Document object model (dom), One by one objects formed by the extraction of pages .
window window : The page needs to be loaded into the browser , The browser will form a window object . This object has two parts . The following visible content is called document Objects and bom object .
document file : yes window A property of , It's also an object . Can pass document Object to get the contents of the document .
Objects abstracted from elements are called element objects 
Objects abstracted from attributes are called attribute objects 
There are three ways to get element objects :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
window.onload=function(){
var myh1=document.getElementById("myh1");
console.log(myh1);
var h1s=document.getElementsByTagName("h1");
console.log(h1s);
var ips=document.getElementsByName("choose");
console.log(ips);
}
</script>
</head>
<body>
<h1 id="myh1"> This is the first one h1</h1>
<h1> This is the second h1</h1>
<div>
Checkbox
</div>
<input type="checkbox" name="choose"/> dance
<input type="checkbox" name="choose"/> Sing a song
<input type="checkbox" name="choose"/> Knock on the code
</body>
</html>
边栏推荐
- Autodesk NavisWorks 2022 software installation package download and installation tutorial
- Pragma once Usage Summary
- Redis installation
- Yyds dry inventory brief chrome V8 engine garbage collection
- d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download
- Software testing Basics - software testing history, process, classification, benefits, limitations
- Simulated process scheduling
- d3dx9_ How to repair 40.dll? Win10 system d3dx9_ What if 40.dll is lost?
- Kubernetes基础自学系列 | Ingress API讲解
- 【多线程】线程通信调度、等待集 wait() 、notify()
猜你喜欢

Simulated process scheduling

Autodesk Navisworks 2022软件安装包下载及安装教程

Oracle概念二

07. Express routing

Determine the maximum number of specific words in a string
![[qt learning notes]qt uses MFC compilation to generate DLL libraries. The problem that DLL cannot be loaded occurs on computers without programming environment](/img/fb/4cf7013687973a7214e51faf3358c0.jpg)
[qt learning notes]qt uses MFC compilation to generate DLL libraries. The problem that DLL cannot be loaded occurs on computers without programming environment

Oracle概念三

Related configuration commands of Huawei LACP

Construction and management practice of ByteDance buried point data flow

全面解析零知识证明:消解扩容难题 重新定义「隐私安全」
随机推荐
P4251 [scoi2015] small convex play matrix (still a little confused)
Software testing - the concept of testing, the detailed introduction of unit testing, and how to design test cases
全面解析零知识证明:消解扩容难题 重新定义「隐私安全」
Solving Poisson equation by tensorflow
Simulated process scheduling
# Cesium实现卫星在轨绕行
leetcode 82. Delete duplicate Element II in the sorting linked list
C language teacher workload management system
Offline disk group
Leetcode 5. Longest Palindromic Substring
D use in
Hospital reservation and registration system - system structure
Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
Yyds dry inventory brief chrome V8 engine garbage collection
Deeply digitise, lead cloud nativity and serve more developers
Leetcode 46 Full Permutation
Part 32 supplement (32) string of ECMAScript
d3dx9_ How to repair 32.dll? d3dx9_ Solution to 32.dll missing
d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
C语言集合运算