当前位置:网站首页>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
边栏推荐
猜你喜欢

使用Sqoop把ADS层数据导出到MySQL

CDH6之Sqoop添加数据库驱动

测试左移和右移

AAAI 2022 | Peking University & Ali Dharma Institute: pruning and compression of pre training language model based on comparative learning

初始JDBC 编程

This "little routine" is set on the dough cake of instant noodles. No wonder programmers are always hungry

Tas (file d'attente prioritaire)

甜心教主:王心凌

高性能纠删码编码

Test shift left and right
随机推荐
MySQL indexes and transactions
Experiment of connecting mobile phone hotspot based on Arduino and esp8266 (successful)
Map and set
深拷贝 事件总线
Take you ten days to easily finish the finale of go micro services (distributed transactions)
Embedded Software Engineer career planning
drools中then部分的写法
SparkContext: Error initializing SparkContext解决方法
Leetcode209 长度最小的子数组
Calculate the maximum path sum of binary tree
The most understandable f-string tutorial in history, collecting this one is enough
使用Sqoop把ADS层数据导出到MySQL
Sse/avx instruction set and API of SIMD
Drools dynamically add, modify, and delete rules
Go学习笔记—基于Go的进程间通信
China traffic sign detection data set
CDH存在隐患 : 该角色的进程使用的交换内存为xx兆字节。警告阈值:200字节
Leetcode14 longest public prefix
Go learning notes - go based interprocess communication
输入一个三位的数字,输出它的个位数,十位数、百位数。