Jump to content

OOUI/Widgets/Buttons and Switches/Code sample 1

From mediawiki.org

JavaScript

[edit]
// Set the 'label' option to plain text, a jQuery selection of elements, 
// or a function. 
var buttonWithLabel = new OO.ui.ButtonWidget( { 
	label: 'Button Label'
} );
$( document.body ).append( buttonWithLabel.$element );

PHP

[edit]
// Set the 'label' option to plain text
$buttonWithLabel = new OOUI\ButtonWidget( [ 
	'label' => 'Button Label'
] );

echo $buttonWithLabel;