I have a table of values that shows the people in a room and the capacity I have two buttons when hit I want to show the least crowded or most crowded room. Here is my code and I use Boostrap for my buttons. Is there a way to use JavaScript or something use to get the buttons to do what I want to do.
<a
href=/top5> <!--When this button is pressed shows least crowed rooms-->
Least Crowded Rooms <!--Name of Button-->
</a>
</button>
<button type="button" class="btn btn-default"> <!--Creates a button for a webpage-->
<a
href=/worst5> <!--When this button is pressed shows most crowed rooms-->
Most Crowded Rooms <!--Name of Button-->
</a>
</button>
<button type="button" class="btn btn-default"> <!--Creates a button for a webpage-->
<a
href=https://studyspacemap.herokuapp.com/>
Map <!--Name of Button-->
</a>
</button>
<div class="col-lg"> <!--Creates a large columum for the webpage-->
<form class="input-group" method="GET" action="search" > <!--Creates a Basic Input Group with text input and submit button. -->
<input type="text" class="form-control" name="query" id="myInput" onkeyup="myFunction()" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Search</button> <!-- Creates search button -->
</span>
</form><!-- /input-group -->
</div><!-- /.col-lg-6 -->
<head>
<base target="_top">
</head>
<body>
<table class="table table-bordered table-condensed table-striped" id="myTable">
<tr>
<!-- <th scope="col">#</th> -->
<th scope="col" style="color: goldenrod">Room</th> <!-- Specifies that the cell is a header for a column and names the colum -->
<th scope="col" style="color: goldenrod">Students</th>
<th scope="col" style="color: goldenrod">Capacity</th>
<th scope="col" style="color: goldenrod">Temperature</th>
<th scope="col" style="color: goldenrod">Percent Of Occupancy % </th>
</tr>
<?var tableData = getSheetData();?>
<?for(var i = 0; i < tableData.length; i++) { ?>
<?if(i == 0) { ?>
<tr>
<?for(var j = 0; j < tableData[i].length; j++) { ?>
<th><?= tableData[i][j] ?></th>
<? } ?>
<? } else { ?>
<tr>
<?for(var j = 0; j < tableData[i].length; j++) { ?>
<td><?= tableData[i][j] ?></td>
<? } ?>
<? } ?>
<? } ?>
</table>
</body>