Widget:GenderSelector: Difference between revisions
Appearance
Created page with "<Script lang="javascript"> var HelloWorld = { init: function () { // Create a button using OOUI // Note! OOUI is being replaced by Codex var button = new OO.ui.ButtonWidget( { label: 'Click me!' } ); // Bind events button.on( 'click', HelloWorld.sayHello ); // Add the button to the DOM $( '.hello-world' ).html( button.$element ); }, sayHello: function () { alert( 'Hello world!' ); } }; mw.loader.using( [ 'oojs-ui-core' ], HelloWorld.init ); <..." |
(No difference)
|
Revision as of 23:06, 30 January 2025
<Script lang="javascript">
var HelloWorld = {
init: function () {
// Create a button using OOUI // Note! OOUI is being replaced by Codex var button = new OO.ui.ButtonWidget( { label: 'Click me!' } );
// Bind events button.on( 'click', HelloWorld.sayHello );
// Add the button to the DOM $( '.hello-world' ).html( button.$element ); },
sayHello: function () { alert( 'Hello world!' ); } };
mw.loader.using( [ 'oojs-ui-core' ], HelloWorld.init );
</script>