Hi, every one....recently i have learn how to delete rows from a table, but i was trying to do it by mean of the row id, and i could do it...so if any one have a wonderful idea..please let me know. please could you also upload the code when you live your advice...thank firends...
Enrico!
0
Newbie Poster
Recommended Answers
Jump to PostEnrico,
Try this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Airshow :: Untitled</title> <script> onload = function(){ var row = document.getElementById('row1'); row.parentElement.removeChild(row); } </script> </head> <body> …
Jump to PostEnrico,
Try this:
<script> function deleteElement(id){ var el = document.getElementById(id); el.parentNode.removeChild(el); return false; } </script>
<table border id="table1"> <tbody> <tr id="row1"> <td>aaaa</td> <td>bbbb</td> <td><a href="" onclick="return deleteElement('row1');">elimina</a></td> </tr> <tr id="row2"> <td>cccc</td> <td>dddd</td> <td><a href="" onclick="return deleteElement('row2');">elimina</a></td> </tr> <tr id="row3"> <td>xxxx</td> <td>yyyy</td> <td>relleno</td> </tr> …
All 7 Replies
Airshow
416
WiFi Lounge Lizard
Team Colleague
itsjareds
29
Junior Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
Enrico!
0
Newbie Poster
Enrico!
0
Newbie Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
sysel
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.