Mixin: TitledElement

.ui.mixin.TitledElement

TitledElement is mixed into other classes to provide a title attribute. Titles are rendered by the browser and are made visible when the user moves the mouse over the element. Titles are not visible on touch devices.

Source:

Example

// TitledElement provides a 'title' attribute to the
    // ButtonWidget class
    var button = new OO.ui.ButtonWidget( {
        label: 'Button with Title',
        title: 'I am a button'
    } );
    $( 'body' ).append( button.$element );

Methods

getTitle() → {string}

Get title.

Source:
Returns:

Title string

Type
string

setTitle(title)

Set title.

Parameters:
Name Type Description
title string | function | null

Title text, a function that returns text, or null for no title

Source:

setTitledElement($titled)

Set the titled element.

This method is used to retarget a titledElement mixin so that its functionality applies to the specified element. If an element is already set, the mixin’s effect on that element is removed before the new element is set up.

Parameters:
Name Type Description
$titled jQuery

Element that should use the 'titled' functionality

Source:

(protected) updateTitle()

Update the title attribute, in case of changes to title or accessKey.

Source: