added DOM examples
This commit is contained in:
parent
be1eb1569a
commit
7a34a388d1
BIN
20240920/24_09_20 - Frontend.pptx
Normal file
BIN
20240920/24_09_20 - Frontend.pptx
Normal file
Binary file not shown.
38
20240920/index.html
Normal file
38
20240920/index.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<style>
|
||||
.myClass{
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="azonosito"></div>
|
||||
<div id="azonosito2">Helló világ!</div>
|
||||
<div name="azonositoNev"></div>
|
||||
<p name="azonositoNev"></p>
|
||||
<p> ASD</p>
|
||||
<p class="myClass">Első</p>
|
||||
<p class="myClass">Második</p>
|
||||
<script>
|
||||
document.getElementById("azonosito").innerHTML = "Érték";
|
||||
let elem = document.getElementById("azonosito2");
|
||||
|
||||
//let elem2 = document.getElementsByClassName("azonositoNev");
|
||||
let elem3 = document.getElementsByName("azonositoNev");
|
||||
console.log(elem3);
|
||||
|
||||
let elem4 = document.getElementsByTagName("p");
|
||||
console.log(elem4);
|
||||
|
||||
let elem5 = document.querySelector(".myClass");
|
||||
|
||||
let elem6 = document.querySelectorAll(".myClass");
|
||||
console.log(elem6);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user