I have this script here
<script type="text/javascript">
$(document).ready(function () {
if($('.subhead').is(':empty')){
$(this).css('background-color', 'none !important');
}
});
</script>
What I am trying to do here is say if my class .subhead is empty then changed the background color, I have multiple .subhead div in code, if I run a script like this
<script type="text/javascript">
$(document).ready(function () {
if($('.subhead').is(':empty')){
alert('hi');
}else{
alert('hello');
}
});
</script>
It will return Hello
Is what I am trying to do possible?
The default setting of
background-colouristransparent, notnone. Try this: