当前位置:网站首页>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>
边栏推荐
- 2022年中国音频市场年度综合分析
- CDH cluster installation
- Under the influence of external factors, how to manage internal resources and reduce costs is the key
- (5) SPI application design and simulation verification 1 - logic sorting
- How to modify / display GPIO status through ADB shell
- Software testing learning - dark horse programmer, software testing learning outline
- Autodesk Navisworks 2022软件安装包下载及安装教程
- 电子智慧套装教程
- Construction and management practice of ByteDance buried point data flow
- The time of localdatetime type (2019-11-19t15:16:17) is queried with the time range of Oracle
猜你喜欢

# Cesium实现卫星在轨绕行

【多线程】线程通信调度、等待集 wait() 、notify()

Alibaba cloud server is invaded

Autodesk NavisWorks 2022 software installation package download and installation tutorial

软件测试基础-软件测试历史流程,分类,好处,限制

d3dx9_ Where is 35.dll? d3dx9_ Where can I download 35.dll

Oracle概念二

When the publish / subscribe mode encounters NET

d3dx9_ How to repair 33.dll? d3dx9_ What if 33.dll is lost?

Ti Click: quickly set up tidb online laboratory through browser | ti- team interview can be conducted immediately
随机推荐
Unity shadow shadow pancaking
Popularization of MCU IO port: detailed explanation of push-pull output and open drain output
Qt5 signal and slot mechanism (basic introduction to signal and slot)
2/14 preliminary calculation geometry
2022 Liaoning's latest eight members (Safety Officer) simulated test question bank and answers
Cesium realizes satellite orbit detour
Mihayou sued Minmetals trust, which was exposed to product thunderstorms
Annual comprehensive analysis of China's audio market in 2022
C语言集合运算
【牛客刷题】NowCoder号称自己已经记住了1-100000之间所有的斐波那契数。 为了考验他,我们随便出一个数n,让他说出第n个斐波那契数。如果第n个斐波那契大于6位则只取后6位。
(5) SPI application design and simulation verification 1 - logic sorting
全面解析零知识证明:消解扩容难题 重新定义「隐私安全」
Autodesk NavisWorks 2022 software installation package download and installation tutorial
[JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes
06. First introduction to express
Kubernetes basic self-study series | introduction to ingress API
Oracle concept II
如何提升IT电子设备效能管理
Part 32 supplement (32) string of ECMAScript
Alibaba cloud server is invaded