Spaces:
Running
Running
enrol button with id "mdb-100" needs to add an action to open a new browser tab with URL "https://learn.mongodb.com/courses/mdb100-mongodb-database-and-security?courseId=" and the value of the select id "mdb100-select"
Browse files- index.html +1 -1
- script.js +6 -1
index.html
CHANGED
|
@@ -58,7 +58,7 @@
|
|
| 58 |
<option value="56f03773-aa3f-4246-bc38-e0e50d9b67ec">SG SGT | 2025 Dec 08 | English (MDB100)</option>
|
| 59 |
<option value="915b651a-fd73-4b6c-8b20-f8a815c85006">UK GMT | 2025 Dec 08 | English (MDB100)</option>
|
| 60 |
</select>
|
| 61 |
-
<button type="button" class="bg-green-600 hover:bg-green-700 text-white px-6 py-3 rounded-lg font-medium transition-colors">Enrol</button>
|
| 62 |
</div>
|
| 63 |
<div class="bg-white p-4 rounded-lg shadow hover:shadow-md transition-shadow">
|
| 64 |
<h4 class="font-medium text-green-600">MDB200</h4>
|
|
|
|
| 58 |
<option value="56f03773-aa3f-4246-bc38-e0e50d9b67ec">SG SGT | 2025 Dec 08 | English (MDB100)</option>
|
| 59 |
<option value="915b651a-fd73-4b6c-8b20-f8a815c85006">UK GMT | 2025 Dec 08 | English (MDB100)</option>
|
| 60 |
</select>
|
| 61 |
+
<button id="enrol-mdb100" type="button" class="bg-green-600 hover:bg-green-700 text-white px-6 py-3 rounded-lg font-medium transition-colors">Enrol</button>
|
| 62 |
</div>
|
| 63 |
<div class="bg-white p-4 rounded-lg shadow hover:shadow-md transition-shadow">
|
| 64 |
<h4 class="font-medium text-green-600">MDB200</h4>
|
script.js
CHANGED
|
@@ -397,7 +397,6 @@ function renderUpcomingDates() {
|
|
| 397 |
upcomingDatesList.appendChild(dateItem);
|
| 398 |
});
|
| 399 |
}
|
| 400 |
-
|
| 401 |
// Initialize the page
|
| 402 |
function init() {
|
| 403 |
const groupedCourses = groupCoursesByMonth(coursesData);
|
|
@@ -415,5 +414,11 @@ function init() {
|
|
| 415 |
buttons[0].textContent = monthNames[now.getMonth()];
|
| 416 |
buttons[1].textContent = monthNames[(now.getMonth() + 1) % 12];
|
| 417 |
buttons[2].textContent = monthNames[(now.getMonth() + 2) % 12];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 418 |
}
|
| 419 |
init();
|
|
|
|
| 397 |
upcomingDatesList.appendChild(dateItem);
|
| 398 |
});
|
| 399 |
}
|
|
|
|
| 400 |
// Initialize the page
|
| 401 |
function init() {
|
| 402 |
const groupedCourses = groupCoursesByMonth(coursesData);
|
|
|
|
| 414 |
buttons[0].textContent = monthNames[now.getMonth()];
|
| 415 |
buttons[1].textContent = monthNames[(now.getMonth() + 1) % 12];
|
| 416 |
buttons[2].textContent = monthNames[(now.getMonth() + 2) % 12];
|
| 417 |
+
|
| 418 |
+
// Add enrol button functionality
|
| 419 |
+
document.getElementById('enrol-mdb100').addEventListener('click', () => {
|
| 420 |
+
const courseId = document.getElementById('mdb100-select').value;
|
| 421 |
+
window.open(`https://learn.mongodb.com/courses/mdb100-mongodb-database-and-security?courseId=${courseId}`, '_blank');
|
| 422 |
+
});
|
| 423 |
}
|
| 424 |
init();
|