当前位置:网站首页>DOM light switch case
DOM light switch case
2022-07-03 21:37:00 【Rice field prospector】
<body>
<img src="./off.gif" id="light">
<script> //1. Get the picture object var light = document.getElementById("light"); var flag = false;// It means that the light is off //2. Bind click event light.onclick = function(){
if(flag){
// Judge if the light is on, then turn it off light.src = "./on.gif" flag = false; }else{
// Judge if the light is off, turn it on light.src = "./off.gif" flag = true; } } </script>
</body>
边栏推荐
- 内存分析器 (MAT)
- What should the future of the Internet be like when Silicon Valley employees flee the big factory and rush to Web3| Footprint Analytics
- Is flush account opening and registration safe and reliable? Is there any risk?
- 90 後,辭職創業,說要卷死雲數據庫
- Notes on MySQL related knowledge points (startup, index)
- Collections SQL communes
- Day 9 HomeWrok-ClassHierarchyAnalysis
- 抓包整理外篇——————autoResponder、composer 、statistics [ 三]
- Sort out several network request methods of JS -- get rid of callback hell
- "Actbert" Baidu & Sydney University of technology proposed actbert to learn the global and local video text representation, which is effective in five video text tasks
猜你喜欢
Rhcsa third day notes
Yiwen teaches you how to choose your own NFT trading market
鹏城杯 WEB_WP
Décompiler et modifier un exe ou une DLL non source en utilisant dnspy
Notes on MySQL related knowledge points (startup, index)
Summary of common operation and maintenance commands
Dahua series books
JS three families
MySQL——idea连接MySQL
Capturing and sorting out external articles -- autoresponder, composer, statistics [III]
随机推荐
Luogu deep foundation part 1 Introduction to language Chapter 6 string and file operation
TiDB 之 TiCDC6.0 初体验
4. Data splitting of Flink real-time project
Xai+ network security? Brandon University and others' latest "interpretable artificial intelligence in network security applications" overview, 33 page PDF describes its current situation, challenges,
Global and Chinese market of wireless hard disk 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese market of telematics boxes 2022-2028: Research Report on technology, participants, trends, market size and share
使用dnSpy對無源碼EXE或DLL進行反編譯並且修改
Talk about daily newspaper design - how to write a daily newspaper and what is the use of a daily newspaper?
技术管理进阶——如何在面试中考察候选人并增大入职概率
flink sql-client 退出,表就会被清空怎么办?
[Yugong series] go teaching course 002 go language environment installation in July 2022
Experience summary of database storage selection
Study diary: February 14th, 2022
Baohong industry | good habits that Internet finance needs to develop
Visiontransformer (I) -- embedded patched and word embedded
Selenium has three waiting methods (forced waiting, implicit waiting, and display waiting)
Yyds dry inventory Chapter 4 of getting started with MySQL: data types that can be stored in the data table
Mysql database ----- common commands of database (based on database)
Yyds dry goods inventory TCP & UDP
Service discovery and load balancing mechanism -service