I have a script that should add the class "leftmax" to the li element with id "spect" when the div element with id "tab2" is empty, but it doesn't seem to be working.
Can someone provide some assistance?
<script type="text/javascript">
$(function(){
if($("div#tab2").html() != "")
{
$("li#spect").addClass("leftmax");
}
});
</script>
<div class="content_container">
<ul class="tabs">
<li><a href="#tab1">TAB1</a></li>
<li id="spect"><a href="#tab2">TAB2</a></li>
<li><a href="#tab3">TAB3</a></li>
</ul>
<div class="tab_container">
<div id="tab1" class="tab_content"><h2>title<h2></div>
<div id="tab2" class="tab_content"></div>
<div id="tab3" class="tab_content"><h2>title<h2></div>
</div>
</div>