当前位置:网站首页>Getting started with DOM
Getting started with DOM
2022-07-03 21:37:00 【Rice field prospector】
DOM
function : control HTML The content of the document
Code : Get the label of the page ( Elements ) object Element
document.getElementById (" id value " )
By element id Get the object of the element
operation Element object :
1. Modify attribute values
<img id="light" src="./image1.jpg" >
<script>
// adopt id Get element object
var light= document.getElementById("light");
alert(" I'm going to change the picture ");
light.src="./image2.jpg";
</script>
2. Modify the content of the label body
attribute :innerHTML
<h1 id="title"> The proletariat United </h1>
<script>
// obtain h1 Label object
var title = document.getElementById("title");
alert(" I need to change the content ");
title.innerHTML=" Long live the people's Republic ";
</script>
边栏推荐
- 90 後,辭職創業,說要卷死雲數據庫
- Transformation between yaml, Jason and Dict
- 内存分析器 (MAT)
- Such as the visual appeal of the live broadcast of NBA Finals, can you still see it like this?
- Basic preprocessing and data enhancement of image data
- The post-90s resigned and started a business, saying they would kill cloud database
- Rhcsa third day notes
- MySQL - database backup
- gslb(global server load balance)技术的一点理解
- What is the maximum number of concurrent TCP connections for a server? 65535?
猜你喜欢

QFileDialog

"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
Implementation principle of inheritance, encapsulation and polymorphism

XAI+网络安全?布兰登大学等最新《可解释人工智能在网络安全应用》综述,33页pdf阐述其现状、挑战、开放问题和未来方向

Hcie security Day10: six experiments to understand VRRP and reliability

No matter how hot the metauniverse is, it cannot be separated from data

MySQL——索引

Hcie security Day11: preliminarily learn the concepts of firewall dual machine hot standby and vgmp

Mysql - - Index

Goodbye 2021, how do programmers go to the top of the disdain chain?
随机推荐
XAI+网络安全?布兰登大学等最新《可解释人工智能在网络安全应用》综述,33页pdf阐述其现状、挑战、开放问题和未来方向
Software testing skills, JMeter stress testing tutorial, obtaining post request data in x-www-form-urlencoded format (24)
No matter how hot the metauniverse is, it cannot be separated from data
TiDB 之 TiCDC6.0 初体验
内存分析器 (MAT)
Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
What is the maximum number of concurrent TCP connections for a server? 65535?
Etcd raft Based Consistency assurance
Redis concludes that the second pipeline publishes / subscribes to bloom filter redis as a database and caches RDB AOF redis configuration files
Scientific research document management Zotero
Persistence of Nacos
内存分析器 (MAT)
The White House held an open source security summit, attended by many technology giants
MySQL——规范数据库设计
Install and use Chrony, and then build your own time server
What if the Flink SQL client exits and the table is emptied?
Hcie security Day11: preliminarily learn the concepts of firewall dual machine hot standby and vgmp
Sort out several network request methods of JS -- get rid of callback hell
gslb(global server load balance)技术的一点理解
17 websites for practicing automated testing. I'm sure you'll like them