.tb button {
width: 100px;
height: 100px;
border-radius: 50%;
background-color: gray;
border: 3px solid black;
margin: 1px;
}
body {
text-align: center;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<div class="container">
<h1>Welcome to Connect Four!</h1>
<p>The object of this game is to connect four of your chips in a row!</p>
<p id="inp">:it is your turn, please pick a column to drop your blue chip.</p>
<table class="tb" align="center">
<thead>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
</thead><br>
<thead>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
</thead><br>
<thead>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
</thead><br>
<thead>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
</thead><br>
<thead>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
</thead><br>
<thead>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
<th><button type="button" name="button"></button></th>
</thead><br>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script>
I want to make the function that returns the index of a clicked button with JQuery. In addition to that, I want to make use of the index later for other functions. For example, if I click the index number 0 button on Google Chrome, I want the function to return 0. How can I make the function with JavaScript? I am a beginner, therefore plain coding would be happy for me.