You need to provide more information about what you're trying to do.
You can do something like $("#button_a, #button_b, #button_c").click(...), but I'm not sure why you're defining those variables. Also, without var, those variables are being defined in the global scope, which is bad practice.
-- Yehuda On Dec 26, 2007, at 12:13 AM, phpcurious wrote:
I wanted to create a function that will return an array consisting values from 3 textboxes. let's say: $('document').ready(function() { $('input#button_a').click(function() { a = $('input#input_text_a').val(); b = $('input#input_text_b').val(); c = $('input#input_text_c').val(); }); $('input#button_b').click(function() { a = $('input#input_text_a').val(); b = $('input#input_text_b').val(); c = $('input#input_text_c').val(); }); $('input#button_c').click(function() { a = $('input#input_text_a').val(); b = $('input#input_text_b').val(); c = $('input#input_text_c').val(); }); }); is there a way I can create the function within this jquery script? or is there a workaround? please teach me, I am new in this aspect. thank you in advance!