34
loading...
This website collects cookies to deliver better user experience
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title>My Budget</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif&display=swap" rel="stylesheet">
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">My Budget</a>
</div>
</nav>
<div class="container bg-white mt-3 rounded">
<div class="my-budget">
<table id="budgetTable" class="table">
<thead>
<tr>
<th>Item</th>
<th>Amount</th>
<th>Action</th>
</tr>
<tr>
<td><input placeholder="Enter item" type="text" autocomplete="off" id="newItem" class="form-control"></td>
<td><input placeholder="Enter amount" type="number" autocomplete="off" id="newAmount" class="form-control"></td>
<td><button id="addButton" type="button" class="btn btn-link">Add</button></td>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
body {
font-family: 'Noto Serif', serif;
background: #D3D3D3;
}
const cancelEdit = () => {
id = 'budgetTable';
document.getElementById('newItem').disabled = false;
document.getElementById('newAmount').disabled = false;
document.getElementById('addButton').disabled = false;
document.getElementById(id).tBodies[0].innerHTML = renderRows(budgetItems);
}