I have the following script:
$i=1;
echo '<table>';
while($row=mysql_fetch_array){
echo '<tr class="'.$i.'">';
echo '<td>'.$row['value'].'</td>';
echo '</tr>';
$i++;
}
echo '</table>';
$i=1;
echo '<table>';
while($row=mysql_fetch_array){
echo '<tr class="'.$i.'">';
echo '<td>'.$row['value'].'</td>';
echo '</tr>';
$i++;
}
echo '</table>';
echo '<script>nr='.mysql_num_rows(query).'</script>';
Javascript:
$(document).ready(function(){
for(i=26; i<=nr; i++){
document.getElementsByClassName(i).style.display='none';
}
});
As you probably figured out,i'm trying to create a pagination script.To start with, no, i don't want an already made js pagination script , i want it to create it alone(well with some help in cases when i am blocked on some issues).The first step is to hide the other's elements starting with the 25 tr.But the problem is that the document.getelementsbyclassname dont affect them...At first i used id for tr,and it worked,but only for the first table(because id must be unique,and in my case the value for the id is the same,so i used class).I can't figure out what is the problem...