javascript - How to get table row by using id in html? -


how tr count html table using id.please check code below

<table id="tableid"> <tr id="a">     <td>a</td> </tr> <tr id="b">     <td>b</td> </tr> 

now want find rownumber using row id.for example rowid 'b' want find rownumber id.any 1 me

here go

var table = document.getelementbyid("tableid"); var rowindex = document.getelementbyid("b").rowindex; table.deleterow(rowindex); 

added code deletion, requested in comments below.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -