Skip to content

Commit

Permalink
redirect_to_appointment_page
Browse files Browse the repository at this point in the history
  • Loading branch information
Soujanya2004 committed Aug 2, 2024
1 parent ee9b31f commit c5ce7d4
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions Html-Files/Doctor Experience.html
Original file line number Diff line number Diff line change
Expand Up @@ -516,19 +516,32 @@ <h4>RAPIDOC Newsletter</h4><br>
const doctorListElement = document.getElementById("doctor-list");
doctorListElement.innerHTML = "";

doctors.forEach(doctor => {
const doctorItem = document.createElement("li");
doctorItem.innerHTML = `
<div class="content">
<h4>${doctor.name}</h4>
<p>Specialization: ${doctor.specialization}</p>
<p>Experience: ${doctor.experience} years</p>
<p>Fee: $${doctor.fee}</p>
</div>
${doctor.image ? `<img src="${doctor.image}" alt="${doctor.name}" style="width: 80px; height: auto; border-radius: 50%;">` : ""}
`;
doctorListElement.appendChild(doctorItem);
});
// Assuming 'doctors' is an array of doctor objects and 'doctorListElement' is the parent UL element

doctors.forEach(doctor => {
// Create a new li element
const doctorItem = document.createElement("li");

// Set the inner HTML of the li element
doctorItem.innerHTML = `
<div class="content">
<h4>${doctor.name}</h4>
<p>Specialization: ${doctor.specialization}</p>
<p>Experience: ${doctor.experience} years</p>
<p>Fee: $${doctor.fee}</p>
</div>
${doctor.image ? `<img src="${doctor.image}" alt="${doctor.name}" style="width: 80px; height: auto; border-radius: 50%;">` : ""}
`;

// Added a click event listener to the li element to redirect to appointment page
doctorItem.addEventListener('click', () => {
window.location.href = 'appointment.html';
});

// Append the li element to the parent UL element
doctorListElement.appendChild(doctorItem);
});

}

function filterDoctors() {
Expand Down

0 comments on commit c5ce7d4

Please sign in to comment.