$dltDiv.click(function(){
$seatdiv.css("background-color","#42de18");
$ticketRowDiv.hide();
price = price-15.50;
$('#price h1').html('$'+price);
});
$seatdiv.click(function(){
$seatdiv.css("background-color","#42de18");
$ticketRowDiv.hide();
price = price-15.50;
$('#price h1').html('$'+price);
});
How could I make the same code in one function and be called seperately?
Cheers.
You can make it a named function and bind for both events:
Or you can combine the jQuery objects: