I have 4 sub images on a page that get their src attribute from a database. they all have a class=”subImage”. When there is no DB entry I would like to hide the element as opposed to have a broken link as i currently have.
I have tried in jQuery:
<script>
$(document).ready(function() {
$('.subImage[src^=""]').css('visibility:hidden');
});
</script>
Am I way off?
thanks.
You pass parameters to the css function as follows:
or