<html> <meta charset="utf-8"> <head> <script type="text/javascript"> function fun(){ var boxes = document.getElementsByName("input"); for(i=0;i<boxes.length;i++){ if(boxes[i].checked){ tr = boxes[i].parentNode.parentNode; tr.parentNode.removeChild(tr); } } } </script> </head> <body> <table id = "test"> <tr><td><input type="radio" name="delete1">yes<input type="radio" name="delete1">no</td><td>1</td><td>2</td><td>3</td></tr> <tr><td><input type="radio" name="delete2">yes<input type="radio" name="delete2">no</td><td>4</td><td>5</td><td>6</td></tr> <tr><td><input type="radio" name="delete3">yes<input type="radio" name="delete3">no</td><td>7</td><td>8</td><td>9</td></tr> <tr><td><input type="radio" name="delete4">yes<input type="radio" name="delete4">no</td><td>10</td><td>11</td><td>12</td></tr> </table> <input type="button" value="删除" onclick="fun()"> </body> </html> 如何修改我的代码才能,删除选中的cell中(如果选了yes),表明删除这行。
付费偷看金额在0.1-10元之间
一周热门 更多>