Skip to content

Commit

Permalink
fix: remove newItem button and randomization of price
Browse files Browse the repository at this point in the history
  • Loading branch information
scissorsneedfoodtoo committed Nov 15, 2023
1 parent 43f8880 commit c9ab057
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion apps/cash-register/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ <h1>Cash Register Project</h1>
<label for="cash">Enter cash from customer:</label>
<input type="number" id="cash" class="user-input" value="" />
<button class="check-btn-styles" id="purchase-btn">Purchase</button>
<button class="check-btn-styles" id="new-btn">New item</button>
</div>
<div class="container">
<div class="top-display-screen-container">
Expand Down
10 changes: 0 additions & 10 deletions apps/cash-register/public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ const message = document.getElementById('message');
const displayChangeDue = document.getElementById('change-due');
const cash = document.getElementById('cash');
const purchaseBtn = document.getElementById('purchase-btn');
const newItemBtn = document.getElementById('new-btn');

const getNewPrice = () => {
displayChangeDue.innerHTML = '';
cash.value = '';
price = Number((Math.random() * 200 + 1).toFixed(2));
message.innerHTML = `Total: $${price}`;
};

const formatResults = (status, change) => {
displayChangeDue.innerHTML = `Status: ${status}`;
Expand Down Expand Up @@ -101,5 +93,3 @@ cash.addEventListener('keydown', e => {
checkResults();
}
});

newItemBtn.addEventListener('click', getNewPrice);

0 comments on commit c9ab057

Please sign in to comment.