-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs_showcase.html
More file actions
42 lines (35 loc) · 1016 Bytes
/
Copy pathjs_showcase.html
File metadata and controls
42 lines (35 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<title>DOM Manipulation Showcase</title>
<style>
.hidden {
display: none;
}
</style>
</head>
<body>
<h1>DOM Manipulation Showcase</h1>
<button onclick="toggleElementVisibility()">Toggle Element</button>
<div id="target-element">
<p>This element can be toggled.</p>
</div>
<button onclick="addNewElement()">Add New Element</button>
<div id="element-container">
<p>Existing Element</p>
</div>
<a href="https://github.com/djones0405" target="_blank">GitHub Profile</a>
<script>
function toggleElementVisibility() {
const targetElement = document.getElementById('target-element');
targetElement.classList.toggle('hidden');
}
function addNewElement() {
const container = document.getElementById('element-container');
const newElement = document.createElement('p');
newElement.textContent = 'New Element';
container.appendChild(newElement);
}
</script>
</body>
</html>