Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

How to get value present in <td> tag when onChange event trigger in react.js ?

How to get value present in <td> tag when onChange event trigger in react.js ?

You can simply add an onChange handler with select

 <tr>
        <th scope="row" key={key} >{key + 1}</th>
        <td>{value.location_id}</td>
<td>
                <select class="form-select form-select-sm" onChange={() => console.log(value.location_id)}>
                    {value.is_active ? (
                        <>
                            <option value="active" selected>Active</option>
                            <option value="inactive">Inactive</option>
                        </>
                    ) :
                        (
                            <>
                                <option value="active" selected>Inactive</option>
                                <option value="inactive">Active</option>
                            </>
                        )}

                </select>
            </td>
        </tr>

7 0

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online