forked from viziolileonardo/cv-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrush.js
23 lines (19 loc) · 810 Bytes
/
rush.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// rush.js
// Function to switch between Leonardo and Vincent CVs
function switchCV() {
const leonardoCV = document.getElementById('leonardo-cv');
const vincentCV = document.getElementById('vincent-cv');
const switchBtn = document.getElementById('switchBtn');
// Toggle display of CVs based on their current visibility
if (leonardoCV.style.display === 'none') {
leonardoCV.style.display = 'block';
vincentCV.style.display = 'none';
switchBtn.innerText = 'Switch CVs';
} else {
leonardoCV.style.display = 'none';
vincentCV.style.display = 'block';
switchBtn.innerText = 'Switch CVs';
}
}
// Event listener for the "Switch CVs" button
document.getElementById('switchBtn').addEventListener('click', switchCV);