.x-btn-widgetbar click

hello, sorry but I have edited the post completely to give a better explanation.

I am creating a Jquery for the .x-btn-widgetbar for when it is clicked on, although my intention is another it would be enough with an alert, why does not this code work?

jquery.('.x-btn-widgetbar').click(function(){
  alert ("It Works!");
})

Thanks

Sorry for the mistake, i solve with correct code…

jQuery('.x-btn-widgetbar').on('click', function() {
     alert ("It Works!");
})   

But, how can I prevent the widgetbar from being expanded and still showing the button and only displaying the alert?

Thanks in advance

Solved, thanks…