const db = firebase.firestore();
function getDataOfBus() {
var dates = document.getElementById('departure-date').value.toString();
var fromd = document.getElementById('from-dest').value.toString()
var tod = document.getElementById('to-dest').value.toString()
console.log(dates + " -" + fromd + " -" + tod)
db.collection('Buses').where("DepartureDate", "==", dates).where("To", "==", tod).
where("From", "==", fromd).get().then((snapshot) => {
    let html = '';
    snapshot.forEach((busDatas) => {
        busData = busDatas.data()
          // console.log(busData.id)
          busData.docId = busDatas.id
        html += `
<div class="single-room-area d-flex align-items-center 
mb-50 wow fadeInUp" data-wow-delay="100ms" id="prince">
<div class="room-thumbnail">
  <img src="${busData.ImageLink}" alt="">
 </div>
<div class="room-content">
<h2><a href="javascript:getID('${busData.docId}');">${busData.TourName}</h2>
  <h6>${busData.From} to ${busData.To}</h6>
  <h4>₹ ${busData.SeatPrice} </h4>
  <div class="room-feature">
    <h6>Boarding Point  <span>${busData.BoardingTime}</span></h6>
    <h6>Dropping Point <span>${busData.DroppingTime}</span></h6>
    <h6>Seats Left <span>${busData.SeatsLeft}</span></h6>
    <h6>Total Time <span>${busData.TotalTime}</span></h6>
    <h6>Departure Date <span>${busData.DepartureDate}</span></h6>
  </div>
  </div>
</div>  `
        document.getElementById('bus-container-dynamic').innerHTML = html;
    })    // End foreach
})      // End then
}
function getID(id) {
  db.collection('Buses').doc(id).get().then((doc) => {
let html = '';
var data =  doc.data();
html += `<h1>${data.TourName} </h1>`
document.getElementById('div-1').innerHTML = html;
window.location = "single-bus.html"
}).catch((e) => {
console.log(e);
 })
}
I have performed this code to display the filtered documents in a html page where i am getting id of the document on which user clicks and i am not able to do this thing, i want to redirect it to "single-bus.html" on clicking and i want to send that id of to the next page "single-bus.html" where i want to use that id to display the datain the html file using that id.
<!-- single-bus.html-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Homepage</title>
</head>
<body>
<div class="classer" id="div-1">
</div>
<script src="./loader.js"></script>
</body>
</html>
 
    