I want to pass id of th tag <th id='1' onClick={this.click.bind(this)}>
to on click function. Suppose i want to print the id of <th>
in click()
function console.log.
here is the code-
<thead>
<tr>
<th id='name' onClick={this.click.bind(this)}>Name</th>
<th id='phone' onClick={this.click.bind(this)}>Phone number</th>
<th id='email' onClick={this.click.bind(this)}>Email</th>
</tr>
</thead>
the click() function-
click(){
console.log('the clicked id is:') //here i want the id
}