Finds toolbar item with id and returns it or its index.
get([id], [returnIndex])

id | string, id of the toolbar item (optional)
returnIndex | boolean, if true returns index in the items array (optional)

Returns object or integer or null.

#### Description

The first argument id is the id of the toolbar item you used when you created toolbar items. The .items array holds all created toolbar items. If toolbar item was not found it will return null.
The second optional argument returnIndex indicates if you want the toolbar item or its index in the .items array.
If you have toolbar defined in the following way: $('#toolbar').w2toolbar({ name : 'toolbar', right : 'text on the right', items : [ { type: 'check', id: 'item1', text: 'Check', img: 'icon-page', checked: true }, { type: 'radio', id: 'item3', group: '1', text: 'Radio 1', img: 'icon-add' }, { type: 'radio', id: 'item4', group: '1', text: 'Radio 2', img: 'icon-add' }, { type: 'menu', id: 'item5', text: 'Drop Down', items: [ { id: 'id1', text: 'menu 1' }, { id: 'id2', text: 'menu 2' }, { id: 'id3', text: 'menu 3' }, ] } ] }); You can get toolbar item: console.log( w2ui['toolbar'].get('item3') ); You can also get toolbar menu item: w2ui['toolbar'].get('item5:id2');