Skip to content

Commit

Permalink
Create dropped-text.html
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar authored Jan 18, 2024
1 parent 6fc8294 commit 883d8cd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions dropped-text.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
#dropdown-text {
display: none;
}
</style>
<title>Auto Dropped Down Text</title>
</head>
<body>

<button onclick="toggleDropdown()">Toggle Text</button>
<div id="dropdown-text">
<p>This is the dropped down text.</p>
</div>

<script>
function toggleDropdown() {
var dropdownText = document.getElementById("dropdown-text");
dropdownText.style.display = (dropdownText.style.display === "none") ? "block" : "none";
}
</script>

</body>
</html>

0 comments on commit 883d8cd

Please sign in to comment.