Apologies if this has been answered elsewhere, but I couldn't find an answer
by searching.

I suppose this is a newbie question. Is it possible to assign the same
function to multiple elements with different id's with one call? 

For example, with the code below, could I assign the onchange handler to
another element with a different id?

 $(document).ready(function() {
   // apply onchange handler to 'time' field
   $("select#time").change(function(){
     // send request with amount & date as variables
         $.post("guestCheck.php", {time: $(this).val(), date:
$("select#date").val()}, function(xml) {
     //assign callback XML to JavaScript variable
         var guests = $("guests",xml).text();
         alert (guests);                                                        
        });
   });

Thanks for any advice.
-- 
View this message in context: 
http://www.nabble.com/multiple-elements%2C-one-function-tf3332805.html#a9267242
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to