[eluser]pickupman[/eluser]
Its you may have one of the lines of code out of order.
Code:
<div id="container">
<h1>Select a Faculty</h1><br>
<?php
foreach($faculties as $row){
echo '<a class="faculty_'.$row->facultyID.'" href="'. $row->facultyID.'">';
echo '<b>'.$row->facultyName.'</b><br/>';
echo '<br/>';
}
?>
</a>
</div>
If you are wanting to return an id on click, but not change the page, you will need to use javascript. Likely jQuery to attach to the click event. Then use a regular expression to get the id from the class string.
Code:
$("a[class^='faculty_']").click(function(event){
var mystr = $(this).attr('class');
var id = mystr.replace(/mystr/ig, 'faculty_');
alert(id);
event.preventDefault();
});
Didn't test javascript, but should be close enough.