Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed the Alert box and Lets's go button #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Will you go out with me? 🥹</title>
<link rel="stylesheet" href="style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
Expand All @@ -11,9 +12,12 @@
href="https://fonts.googleapis.com/css2?family=Leckerli+One&display=swap"
rel="stylesheet"
/>

</head>
<body>
<div id = "alert"></div>
<div class="wrapper">
<h2 class="question">Hey</h2>
<h2 class="question">Will you go out with me?</h2>
<img
class="gif"
Expand All @@ -26,6 +30,5 @@ <h2 class="question">Will you go out with me?</h2>
</div>
</div>
<script src="script.js"></script>

</body>
</html>
8 changes: 6 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ const handleYesClick = () => {
letsGoBtn.addEventListener("click", () => {
const randomIndex = Math.floor(Math.random() * dateIdeas.length);
const selectedDateIdea = dateIdeas[randomIndex];

alert(`How about this romantic date idea: ${selectedDateIdea}`);
letsGoBtn.textContent = "Something else";
document.getElementById("alert").innerHTML = `<div class="alert alert-success" role="alert">
<h4 class="alert-heading">How about this romantic date idea: </h4>
<hr>
<p>${selectedDateIdea}</p>
</div>`
});

// Replace yesBtn with the new letsGoBtn
Expand Down