Toggle Slide - bind function

Toggle Slide - bind function

Hi,

I want to visualize my house (lights and raffstores) with jquery mobile to eg. switch the lights with my smartphone.
To switch on/off the lights I want to use the toggle slide. But when I use this, I have to create a change function for every slider. Is it possible, to pack the slider with a function in a some kind of object? So when I add a toggle slider the change function is already included?

my first slider:

  1. $(function(){
  2.             $("#light1").bind("change",function(event,ui){
  3.                 console.log("test");
  4.             })
  5. });
  6. <select name="light1" id="light1" data-role="slider">
  7.                     <option value="off">OFF</option>
  8.                     <option value="on">ON</option>
  9. </select>

Thanks!