Witam mam problem z usunięciem z tabeli wybranych linii
sprawa wygląda w ten sposób pobieram tabelę ze strony:
<?php
$strona = file_get_contents('http://cw.money.pl/surowce_gf.html');
echo '<pre id="tabelka">';
preg_match ('/<table style="border:0;width:100%;font:normal 11px Tahoma;padding:0;border-collapse: collapse;background-color:#FFF;text-align:left;\">(.*)<\/table>/s', $strona, $tabela); // (.*) pobiera wszystko bez wyjątku
//var_dump($tabela);
echo $tabela[0];
?>
OK się wyświetla
a teraz chcę wybrane linie tabeli usnąć tak by znalazłem taki kod (niestety nie chce po kliknięciu a OD RAZU po prostu po załadowaniu):
function usun_wiersze(id) {
var tab = document.getElementById(id);
var td = tab.getElementsByTagName('td');
for (x=0; x<td.length; x++) {
td[x].onmouseover = function() {
this.parentNode.className = 'usun'; //ustawiamy klase hover dla TR
}
td[x].onmouseout = function() {
this.parentNode.className = '';
}
}
}
usun_wiersze('tabelka')