Skip to content

Commit

Permalink
booked seat information enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
khalid586 committed Feb 18, 2024
1 parent e92e29e commit c041be8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 8 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@

</div>
<div>
<p>Seats <sup id = "seatTaken" class="bg-green-500 text-white px-1 rounded-full">0</sup></p>
<p class="font-bold text-2xl mt-4">Selected seats</p>
<p id = "selected" class=""></p>
<div class="flex justify-between font-bold">
<p>Seat <sup id = "seatTaken" class="bg-green-500 text-white px-1 rounded-full">0</sup></p>
<p>Class</p>
<p>Price</p>
</div>
<div class="" >
<p id = "selected"></p>
</div>
<p class="font-bold">Total : <span id = "total">0</span></p>

<br>
Expand Down
5 changes: 3 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ allSeats.forEach(seats =>
document.getElementById('coupon-btn').removeAttribute('disabled');
}

const newSeat = document.createElement('p');
newSeat.innerText = `You have selected ${seat.id}`;
const newSeat = document.createElement('div');
newSeat.classList.add('flex','justify-between');
newSeat.innerHTML = `<p>${seat.id}</p> <p>Economy</p> <p>550</p>`;
document.getElementById('selected').appendChild(newSeat);

let seatsLeft = parseInt(document.getElementById('remaining').innerText);
Expand Down

0 comments on commit c041be8

Please sign in to comment.