当前位置:网站首页>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>
边栏推荐
- 电子科技大学|强化学习中有效利用的聚类经验回放
- Design e-commerce seckill system
- QT6 QML book/qt quick 3d/ Basics
- [vulnhub shooting range] impulse: lupinone
- 2022-02-15 Daily: 2022 AAAI fellow release
- Yyds dry inventory hcie security Day12: concept of supplementary package filtering and security policy
- Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
- UI automation test: selenium+po mode +pytest+allure integration
- Hcie security Day10: six experiments to understand VRRP and reliability
- Experience summary of database storage selection
猜你喜欢
90 後,辭職創業,說要卷死雲數據庫
Getting started with postman -- environment variables and global variables
Basic preprocessing and data enhancement of image data
Teach you how to install aidlux (1 installation)
Single page application architecture
Pengcheng cup Web_ WP
JS three families
Scientific research document management Zotero
Capturing and sorting out external articles -- autoresponder, composer, statistics [III]
"Designer universe" argument: Data Optimization in the design field ultimately falls on cost, safety and health | chinabrand.com org
随机推荐
What should the future of the Internet be like when Silicon Valley employees flee the big factory and rush to Web3| Footprint Analytics
APEC industry +: father of the king of the ox mill, industrial Internet "king of the ox mill anti-wear faction" Valentine's Day greetings | Asia Pacific Economic media | ChinaBrand
Qualcomm platform WiFi -- P2P issue
@Transactional注解失效的场景
MySQL - index
Luogu deep foundation part 1 Introduction to language Chapter 6 string and file operation
"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
"Designer universe" argument: Data Optimization in the design field ultimately falls on cost, safety and health | chinabrand.com org
What is the maximum number of concurrent TCP connections for a server? 65535?
Preliminary understanding of C program design
Experience summary of database storage selection
Notes on MySQL related knowledge points (startup, index)
Yyds dry goods inventory TCP & UDP
flink sql-client 退出,表就会被清空怎么办?
Teach you how to install aidlux (1 installation)
Luogu deep foundation part 1 Introduction to language Chapter 7 functions and structures
电子科技大学|强化学习中有效利用的聚类经验回放
Selenium has three waiting methods (forced waiting, implicit waiting, and display waiting)
Dahua series books
Décompiler et modifier un exe ou une DLL non source en utilisant dnspy