How do I select the <a> tag with class=“lightbox” from these codes below using jQuery,
<div class="row">
<div class="span12">
<div id="paginate" align="left">
<table width="1170" border="0">
<tr>
<td width="70"> </td>
<td width="1000" align="left">
<?php
echo $this->pagination->create_links();
echo '<br><br>';
if(!empty($records)) {
foreach($records as $record) {
?>
<table border="0">
<tr>
<td align="left">
<a href="<?php echo base_url().'images/'.$record['photo_url']; ?>" class="lightbox">
<img src="<?php echo base_url() . 'icons/' . 'camera.jpg'; ?>" alt="<?php echo $record['photo_url']; ?>" />
</a>
<a href="<?php echo site_url('main/show_offer/' . $record["video_url"]); ?>">
<img src="<?php echo base_url() . 'icons/' . 'play.jpg'; ?>" alt="<?php echo $record['video_url']; ?>" />
</a>
</td>
</tr>
<tr>
<td align="left">
<a href="<?php echo $record["title_url"]; ?>">
<?php echo '<h2>'. $record['title'] .'</h2>'; ?>
</a>
<?php
echo ' '. $record['description'];
if($record['version'] != 0){
echo '<br><b>Version:</b> '. $record['version'];
}
if($record['last_update'] != '0000-00-00'){
echo '<br><b>Last update:</b> '. $record['last_update'];
}
if($record['date_started'] != '0000-00-00'){
echo '<br><b>Date started:</b> '. $record['date_started'];
}
if($record['date_finished'] != '0000-00-00'){
echo '<br><b>Date finished:</b> '. $record['date_finished'];
}
if($record['technology'] != ''){
echo '<br><b>Technology:</b> '. $record['technology'];
}
echo '<br><br>';
?>
</td>
</tr>
</table>
<?php
}
}
echo $this->pagination->create_links();
?>
</td>
<td width="100"> </td>
</tr>
</table>
<br><br>
</div>
</div>
</div>
I tried these codes below but it did not work,
<script type="text/javascript">
$(function() {
$('a.lightbox').lightBox();
});
</script>
Can some give shed to this please.
Thank you very much in advanced.