当前位置:网站首页>BOM DOM
BOM DOM
2022-07-02 12:28:00 【There is no water in the sea】
One 、BOM



Be careful : window Inherit EventTarget
Two 、DOM

1、 Event monitoring 

2、 Flow of events - Event Bubbling / Event capture 


3、 Properties and methods of event objects
const spanEL = document.querySelector(".span");
// When calling back this function , It will deliver event Parameters
spanEL.addEventListener("click", function (event) {
console.log("span Clicked ", event);
console.log(" Type of event ", event.type);
// When clicking occurs, the element that handles clicking is different
console.log(" The elements of the event ", event.target, event.currentTarget);
console.log(" Where the event occurred ", event.offsetX, event.offsetY);
});
// Common methods
// preventDefault, Prevent default behavior
const aEl = document.querySelector("a")
aEl.addEventListener("click", (event) => {
event.preventDefault();
})
// stopPropagation , Prevent event capture
边栏推荐
- Go learning notes - multithreading
- Is the neural network (pinn) with embedded physical knowledge a pit?
- Docker-compose配置Mysql,Redis,MongoDB
- Experiment of connecting mobile phone hotspot based on Arduino and esp8266 (successful)
- 寻找二叉树中任意两个数的公共祖先
- drools执行指定的规则
- [FFH] little bear driver calling process (take calling LED light driver as an example)
- Embedded Software Engineer career planning
- 倍增 LCA(最近公共祖先)
- kubeadm join时出现错误:[ERROR Port-10250]: Port 10250 is in use [ERROR FileAvailable--etc-kubernetes-pki
猜你喜欢

High performance erasure code coding

刷题---二叉树--2

Heap (priority queue)

CDA data analysis -- Introduction and use of aarrr growth model

Simple use of drools decision table

Experiment of connecting mobile phone hotspot based on Arduino and esp8266 (successful)

drools中then部分的写法

Simple understanding of ThreadLocal

Programmers can't find jobs after the age of 35? After reading this article, you may be able to find the answer

CDH6之Sqoop添加数据库驱动
随机推荐
Input a three digit number and output its single digit, ten digit and hundred digit.
String palindrome hash template question o (1) judge whether the string is palindrome
ES集群中节点与分片的区别
arcgis js 4.x 地图中加入图片
【C语言】杨辉三角,自定义三角的行数
PyTorch nn. Full analysis of RNN parameters
Leetcode922 按奇偶排序数组 II
Map and set
CPU指令集介绍
二分刷题记录(洛谷题单)区间的甄别
Calculate the maximum path sum of binary tree
post请求体内容无法重复获取
Leetcode122 the best time to buy and sell stocks II
Leetcode - Sword finger offer 37, 38
高性能纠删码编码
(C language) input a line of characters and count the number of English letters, spaces, numbers and other characters.
CDA数据分析——Excel数据处理的常见知识点归纳
How to write a pleasing English mathematical paper
drools执行String规则或执行某个规则文件
Full link voltage measurement