-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscriptt.js
More file actions
25 lines (23 loc) · 1012 Bytes
/
Copy pathscriptt.js
File metadata and controls
25 lines (23 loc) · 1012 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
document.addEventListener("DOMContentLoaded", function () {
const options = document.querySelectorAll(".option");
let selectedOption;
options.forEach((option) => {
option.addEventListener("click", function () {
if (selectedOption) {
selectedOption.classList.remove("selected");
}
option.classList.add("selected");
selectedOption = option;
});
});
const startButton = document.getElementById("startButton");
startButton.addEventListener("click", function () {
if (selectedOption) {
const selectedValue = selectedOption.getAttribute("data-value");
console.log("Selected Value:", selectedValue);
// Replace this console.log statement with the logic that should be executed when a job title is selected and the "Start" button is clicked
} else {
alert("Please select a job title before starting.");
}
});
});