Jquery removeAttr('title'); problem

Hello experts.
Using this http://jsfiddle.net/AlexCode/b2GPv/129/ to create jquery ui check boxes i have a problem. I want to remove the title attribute of the created buttons.
The $( this ).removeAttr( "title" ); does not the job.
Any help?
(the above link is a very nice solution of this question: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/Q_28623177.html#a40629191)
LVL 2
PanosAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JonNormanCommented:
The checkbox() function adds the title attr. so after calling it you can remove it:

$(function() {
  $( "input[type='checkbox']" ).checkbox();
  $("button.ui-checkbox").removeAttr("title");
});
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JonNormanCommented:
full code:

(function( $ ) {
   
    $.widget( "app.checkbox", {
   
        _create: function() {

            // Call the default widget constructor first.            
            //this._super();
            var w = this;
           
            // Hide the HTML checkbox, then insert our button.
            w.element.addClass( "ui-helper-hidden-accessible" );
            w.button = $( "<button/>" ).insertAfter( this.element );
           
            // Configure the button by adding our widget class,
            // setting some default text, default icons, and such.
            // The create event handler removes the title attribute,
            // because we don't need it.
            w.button.addClass( "ui-checkbox" )
                       .text( "checkbox" )
                       .button({
                           text: false,
                           icons: {
                               primary: "ui-icon-blank"
                           }
                       });
           
            // Listen for click events on the button we just inserted and
            // toggle the checked state of our hidden checkbox.
            w.button.on('click', function( e ) {
                    w.element.prop( "checked", !w.element.is( ":checked" ) );
                    w.refresh();
                });

            // Update the checked state of the button, depending on the
            // initial checked state of the checkbox.
            w.refresh();
           
        },
       
        _destroy: function() {
           
            // Standard widget cleanup.
            //this._super();
           
            // Display the HTML checkbox and remove the button.
            w.element.removeClass( "ui-helper-hidden-accessible" );
            w.button.button( "destroy" ).remove();
       
        },
       
        refresh: function() {
            // Set the button icon based on the state of the checkbox.
            this.button.button( "option", "icons", {
                primary: this.element.is( ":checked" ) ?
                "ui-icon-check" : "ui-icon-blank"
            });

        }
   
    });
   
    // Create three checkbox instances.
    $(function() {
        $( "input[type='checkbox']" ).checkbox();
        $("button.ui-checkbox").removeAttr("title");
    });
   
})( jQuery );
0
PanosAuthor Commented:
Hi expert JonNorman
Thank you for your help. Code is working fine
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.