I have a function that dynamically creates navigation in a web page. The problem I have is that when I click on the top nav buttons it works. As I know you can only use ID's once. This is the problem. How can I use classes instead of ids to make sure that all the navigations work?
Thanks in advance. Any questions, just comment and i'll reply in a jiffy.
The code is :
function printComments($amb){
foreach ($amb as $key => $a) {
<ul class="amb_tool nav nav-pills list-inline amb_tool_pill">
<li><a data-toggle="pill" href="#amb_info"><span class="glyphicon glyphicon-info-sign"></span></a></li>
<li><a data-toggle="pill" href="#amb_comm"><span class="glyphicon glyphicon-comment"></span></a></li>
</ul>
<div class="tab-content">
<div id="amb_info" class="tab-pane">
<div class="well well-sm amb-well">
{$a['amb_about']}
</div>
</div>
<div id="amb_comm" class="tab-pane">
<div class="well well-sm amb-well">
HTML;
$html .= outputComments($a['comments']);
$html .= <<<HTML
</div>
</div>
</div>
}
}