The HTML Code
echo "<ul id='sub'>";
if($Set == null){
echo '<li class="BlankSeat" ></li>';
}
if in database status yes or no add class in red color
elseif($status == 'no' || $status == 'yes'){
echo '<li class="occupied" title="Row'.$val1.'" name="'.$val2.'"
value="'.$val3.'"></li>';
}
elseif($name=='PINK'){
echo '<li class="pink" title="Row'.$val1.'" name="'.val2.'"
value="'.$val3.'"></li>';
}
elseif($name=='YELLOW'){
echo '<li class="yellow" title="Row'.$val1.'" name="'.$val2.'"
value="'.$val3.'"></li>';
}
else{
echo '<li class="orange" title="Row'.$val1.'" name="'.$val2.'"
value="'.$val3.'"></li>';
}
echo "</ul>";
}
echo '</div>';
}
else
{
echo "No result Available";
}
This is my code
$('li').click(function(e) {
var $this = $(this);
First part where iam adding class when click on one of them
if($(this).hasClass('pink')|| $(this).hasClass('yellow') ||
$(this).hasClass('orange'))
{
$(this).addClass('Booked').removeClass('pink','yellow','orange');
}
Here i want to remove the booked class with only which one is clicked
else
{
$(this).addClass('pink').removeClass('Booked');
$(this).addClass('yellow').removeClass('Booked');
$(this).addClass('orange').removeClass('Booked');
}}