Writing Stateful Plugins with the jQuery UI Widget Factory

Writing Stateful Plugins with the jQuery UI Widget Factory

Hi there,

I'm new in jQuery, I'm studing plugins and in the part of   The Widget Factory: Under the Hood , I can't make the next code work:

  
var bar = $( "<div />")
.appendTo( "body" )
.progressbar()
.data( "progressbar" );
// Call a method directly on the plugin instance.
bar.option( "value", 50 );
// Access properties on the plugin instance.
alert( bar.options.value );

For a complete reference, this is the link:

Good day!!!