当前位置:网站首页>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
边栏推荐
- Lekao: 22 year first-class fire engineer "technical practice" knowledge points
- Day12 control flow if switch while do While guessing numbers game
- Map and set
- 高德地图测试用例
- CV2 in OpenCV VideoWriter_ Fourcc() function and cv2 Combined use of videowriter() function
- AAAI 2022 | Peking University & Ali Dharma Institute: pruning and compression of pre training language model based on comparative learning
- (C language) octal conversion decimal
- When uploading a file, the server reports an error: iofileuploadexception: processing of multipart / form data request failed There is no space on the device
- 怎样写一篇赏心悦目的英文数学论文
- (C language) input a line of characters and count the number of English letters, spaces, numbers and other characters.
猜你喜欢
AI mid stage technology research
Experiment of connecting mobile phone hotspot based on Arduino and esp8266 (successful)
5g era, learning audio and video development, a super hot audio and video advanced development and learning classic
Simple use of drools decision table
测试左移和右移
Performance tuning project case
分布式机器学习框架与高维实时推荐系统
Drools dynamically add, modify, and delete rules
ES集群中节点与分片的区别
arcgis js 4.x 地图中加入图片
随机推荐
二分刷题记录(洛谷题单)区间的甄别
The programmer and the female nurse went on a blind date and spent 360. He packed leftovers and was stunned when he received wechat at night
From scratch, develop a web office suite (3): mouse events
Those logs in MySQL
Leetcode122 the best time to buy and sell stocks II
Simple use of drools decision table
Go学习笔记—多线程
There is a hidden danger in CDH: the exchange memory used by the process of this role is XX megabytes. Warning threshold: 200 bytes
JZ63 股票的最大利润
Leetcode739 daily temperature
CDH6之Sqoop添加数据库驱动
Sub thread get request
Test shift left and right
Less than three months after the programmer was hired, the boss wanted to launch the app within one month. If he was dissatisfied, he was dismissed immediately
Drools terminates the execution of other rules after executing one rule
Codeforces 771-div2 C (trouble, permutation is not very good)
drools动态增加、修改、删除规则
深拷贝 事件总线
Leetcode - Sword finger offer 37, 38
Embedded Software Engineer career planning