forked from AtitBimali/web-tech-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
9.html
31 lines (27 loc) · 937 Bytes
/
9.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Show/Hide Paragraph</title>
</head>
<body>
<button onclick="toggleParagraph()">Show/Hide</button>
<p id="myParagraph" style="display: none;">This is the paragraph content. This is the ninth lab assignment
of the "Web Tech" subject, that we have completed in the 5<sup>th</sup> semester of B.Sc.CSIT.
</p>
<script>
function toggleParagraph() {
var paragraph = document.getElementById('myParagraph');
// Check the current display property
if (paragraph.style.display === 'none' || paragraph.style.display === '') {
// If hidden or not set, show the paragraph
paragraph.style.display = 'block';
} else {
// If visible, hide the paragraph
paragraph.style.display = 'none';
}
}
</script>
</body>
</html>