Skip to content

Commit

Permalink
Merge pull request #1117 from Soujanya2004/redirect
Browse files Browse the repository at this point in the history
redirect to appointment page
  • Loading branch information
varshith257 authored Aug 3, 2024
2 parents ee9b31f + c5ce7d4 commit 19125e3
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 19125e3

Please sign in to comment.