jquery for hide repeating clicking image values
<p>I am doing a project in bus seat selection.I am in middle of the project.
  Now i showing the bus seating arrangement to the customer.When the user click the unselected seat it shows the seat in colored(ie., selected) and also show the selected seat values to the user.This works fine.
  when the user deselect the selected seat,the seat deselect and come back to previous stage but the values not removing of that selected seat.
  Please have a look at the code.</p>

<pre><code>&lt;?php
echo "&lt;table&gt;";
for($i=0;$i&lt;5;$i++)
 {
echo "&lt;tr&gt;";
for($j=0;$j&lt;12;$j++)
{
    echo "&lt;td&gt;";
    $k=$i.$j;
?&gt;
    &lt;img src="Seat.jpg" id="&lt;?php echo $k; ?&gt;" class="off"&gt;
   &lt;?php
    echo "&lt;/td&gt;";
}
echo "&lt;/tr&gt;";
}
echo "&lt;/table&gt;";

?&gt;
 &lt;div class="seatno"&gt;&lt;/div&gt;
 &lt;script type="text/javascript"&gt;
 $(document).ready(function(){             
  $("img").click(function(){
 var imageid = $(this).attr("id");
   if(imageid)
 {
     if ($(this).hasClass('off')) 
     {
   $(this).attr("src","Seat-availed.jpg").addClass('on').removeClass('off');
   $(".seatno").append(imageid+",");
}
else
{
     $(this).attr("src","Seat.jpg").removeClass('on').addClass('off');
  // $(".seatno").css("color","red");
  var editid;
  var rmv = $(".seatno").html();
  var editid =  $(this).attr("id");
  var finder = rmv.find(editid);

   alert(finder);   
   }
}
   });
   });
  &lt;/script&gt;
</code></pre>

<p>please find the solution
This code is just like the redbus.in</p>
