jquery - Hiding a Table Row -
so here's scenario.
i imported set of data xml file monitor status of printers , formatted in table.
now, want make series of buttons (or checkboxes) that, when clicked, hide corresponding table row. i've tried several methods , none of them have been able work.
here's code.
<html> <head> <meta http-equiv="refresh" content="60"> <style> table, th, td { border: 1px solid black; border-collapse:collapse; } th, td { padding: 5px; } </style> </head> <body> <script> xmlhttp=new xmlhttprequest(); xmlhttp.open("get","runningprinters.xml", false); xmlhttp.send(); xmldoc=xmlhttp.responsexml; document.write("<table><tr><th>printer</th><th>status</th></tr>"); var x=xmldoc.getelementsbytagname("printer"); (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x[i].getelementsbytagname("name")[0].childnodes[0].nodevalue); document.write("</td><td>"); document.write(x[i].getelementsbytagname("status")[0].childnodes[0].nodevalue); document.write("</td></tr>"); } document.write("</table>"); </script> <input type = "checkbox" id = "check1">1104 down<br/> <input type = "checkbox" id = "check2">2102 down<br/> <input type = "checkbox" id = "check3">2103 down<br/> <input type = "checkbox" id = "check4">2112 down<br/> <input type = "checkbox" id = "check5">2120 down<br/> </body> </html>
so checkboxes should hide corresponding row in table. been stuck on few days.
any appreciated.
here example of how remove row table using javascript.
Comments
Post a Comment