## Integrating with Other Libraries Integration with third party libraries or vanilla javascript code can be achieved via the [`config` attribute of virtual elements](mithril.md#accessing-the-real-dom). It's recommended that you encapsulate integration code in a component or a helper function. The example below shows a simple component that integrates with the [select2 library](http://ivaynberg.github.io/select2/). ```javascript var Select2 = { // Returns a select box view: function(ctrl, attrs) { var selectedId = attrs.value().id; //Create a Select2 progrssively enhanced SELECT element return m("select", {config: Select2.config(attrs)}, [ attrs.data.map(function(item) { var args = {value: item.id}; // Set selected option if(item.id == selectedId) { args.selected = "selected"; } return m("option", args, item.name); }) ]); }, /** Select2 config factory. The params in this doc refer to properties of the `ctrl` argument @param {Object} data - the data with which to populate the