Skip to content

Commit

Permalink
Bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
prishsha committed Oct 7, 2024
1 parent 9538de8 commit edb6d36
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,7 @@ document
.addEventListener("click", ()=>{
const testimonialsContainer = document.getElementById(
"testimonials-container"
)});

document.getElementById('bookNow').addEventListener('click', function () {
const name=document.getElementById('fullName').value.trim();
const phone=document.getElementById('phone').value.trim();
const email=document.getElementById('email').value.trim();
const city=document.getElementById('city').value.trim();
const vehicle=document.getElementById('vehicle').value.trim();
const pickupDate=document.getElementById('pickupDate').value.trim();
const dropoffDate=document.getElementById('dropoffDate').value.trim();

if(!name || !phone || !email || !city || !vehicle || !pickupDate || !dropoffDate)
{
alert('Please fill all fields');
}
else
alert('Booking confirmed!');
});
);

const newTestimonials = [
{
Expand Down Expand Up @@ -148,11 +131,30 @@ document

testimonialsContainer.appendChild(testimonialDiv);
});

});
const themeSwitch = document.getElementById('theme-switch'); // Ensure this matches your HTML button's ID
const body = document.body;
const header = document.querySelector('header');
const footer = document.querySelector('footer');

document.getElementById('bookNow').addEventListener('click', function () {
const name=document.getElementById('fullName').value.trim();
const phone=document.getElementById('phone').value.trim();
const email=document.getElementById('email').value.trim();
const city=document.getElementById('city').value.trim();
const vehicle=document.getElementById('vehicle').value.trim();
const pickupDate=document.getElementById('pickupDate').value.trim();
const dropoffDate=document.getElementById('dropoffDate').value.trim();

if(!name || !phone || !email || !city || !vehicle || !pickupDate || !dropoffDate)
{
alert('Please fill all fields');
}
else
alert('Booking confirmed!');
});

// Function to enable dark mode
function enableDarkMode() {
themeSwitch.classList.add('dark-theme'); // Update the switch appearance
Expand Down

0 comments on commit edb6d36

Please sign in to comment.