I'm using a jQuery plugin to show balloons as tooltips.
I have the following table generate with PHP:
<?php
for($i = 1; $i < sizeof($consulta_id); $i++){
$data = str_replace('-', '/', $consulta_data[$i]);
$data = date('d/m/Y', strtotime($data));
echo "<tr>";
echo "<td>" .$consulta_id[$i]."</td>";
echo "<td>" .$data."</td>";
echo "<td>" .$consulta_hora[$i]."</td>";
echo "<td>" .$consulta_desc[$i]."</td>";
echo "<td id=\"".$i."\">".$consulta_inst[$i]."</td>";
echo "<td>" .$consulta_prof[$i]."</td>";
echo "</tr>";
}
?>
The script below generates the tooltips:
<script>
$(function() {
//var id;
$('#id').balloon({
url: '../functions/retorna-dados-instituicao.php?idInstituicao=' + id,
position: "bottom",
offsetX: -30,
});
}
});
</script>
I need to pass to this script each "$consulta_inst" id dynamically to generate a different toolltip for each "consulta" acording to this id, there is a way to iterate my table and select the elements with the selector "$"?