limct
asked on
How to get html table's particular column value?
Hi,
I am writing a javascript function to delete a row from a table filled with data. How to get one of the html table's column values so that I can delete the selected row?
Please give answer with code.
I am writing a javascript function to delete a row from a table filled with data. How to get one of the html table's column values so that I can delete the selected row?
Please give answer with code.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
First item in your member profile ragerino is LotusScript. Are you a PCLP?
Thanks for points and grading.
ragerino, wir sehen uns ;-)
ragerino, wir sehen uns ;-)
Sorry Alex, I confused your member name with another guy.
hehe :)
if you just want to delete the html-table-row put this td in your table
--------------------------
....
<td><a href="javascript:void null;" onclick="var e=this;while(e.tagName!='T
....
--------------------------
you can also make a function:
put this to your head
--------------------------
<script type="text/javascript">
function delRow(e){
//first find the tablerow
while(e && e.tagName!='TR')
e=e.parentNode;
//if found then remove it form the table (e.parentNode='TBODY')
if(e)
e.parentNode.removeChild(e
}
</script>
--------------------------
then the tablecell can look like this:
--------------------------
....
<td><img src="yourdelicon.gif" border=0 style="cursor:pointer;" onclick="delRow(this);"></
....
--------------------------
hope this helps and you give me the points :)