Hello, I have problem with my JS function. Please help me, I need this code until today and I can't understand what is the wrong :(
foreach($group as $i => $name){
print'<li onclick="groups(\'group'.$i.'\');" >'.$name.'</li>';
}
Then I have this code:
$moretags = "<script>";
$moretags .= 'function groups(grid){';
foreach($group as $i => $name){
$moretags .= '
if(grid == \'group'.$i.'\'){
document.getElementById(\'show\').innerHTML = \'group'.$i.'\';
}
';
}
$moretags .= '</script>';