title: JQuery Slider: Calling function without ID but with the object
body: <p>I'm implementing a Slider with JQuery and I have the following problem.</p>
  <p>The function is called upon load and it generates a slider with the Id from the div-element:</p>
  <pre><code>$(function() {
          $( &quot;#slider&quot; ).slider({
              value: 0,
              min: 0,
              max: 10,
              step: 1,
              slide: function( event, ui ) {
                  $( &quot;#value&quot; ).val(ui.value );
              }
          });
          $( &quot;#value&quot; ).val( $( &quot;#slider&quot; ).slider( &quot;value&quot; ) );
      });
  
  &lt;div id=&quot;slider&quot; &gt;
  </code></pre>
  <p>I would rather have it called upon loading and pass the object -something like this:</p>
  <pre><code>function createSilder(object) {
          object.slider({
              value: 0,
              min: 0,
              max: 10,
              step: 1,
              slide: function( event, ui ) {
                  $( &quot;#value&quot; ).val(ui.value );
              }
          });
          $( &quot;#value&quot; ).val( $( &quot;#slider&quot; ).slider( &quot;value&quot; ) );
  }
  
  &lt;div id=&quot;slider&quot; onload=&quot;createSlider(this)&quot;&gt;
  </code></pre>
  <p>Is this possible?</p>