简体   繁体   中英

how to fetch value of particular row column by clicking button using javascript

here is my html code

  <div class="container">
<table class="table table-bordered">
         <thead>
            <td>Name</td>
            <td>Address</td>
            <td>city</td>
            <td>Pincode</td>
            <th>Options</th>
         </thead>
         
         {% for row in rows %}
            <tr>
               <td>{{row["registraion_number"]}}</td>
               <td>{{row["rc_number"]}}</td>
               <td> {{ row["owner_name"]}}</td>
               <td>{{row['state']}}</td>  
               <td><button type="button" class="use-address"></td>
            </tr>
         {% endfor %}
      </table>
      </div>
      <a href = "/">Go back to home page</a>
   </body>
</html>

this is my image of table coming在此处输入图片说明

how to fetch name by selecting the particular button at that row

any help would be helpful

You get the extra column because you use an opening tag and not a closing tag at the end.

<td><button type="button" class="use-address" /><td>
                                                ^^^^ 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM