Add the data-type="horizontal" attribute for the buttons to sit side-by-side. Select the option … However I believe you could find a compromise by using ES6 modules instead of CommonJS modules. How to get value of data attribute and use it in jQuery? Get­ting a val­ue involves just using the key­word, as in this exam­ple which oper­ates on the markup above: var baz = $('div').data('foo'); Javascript Web Development Object Oriented Programming. I think you meant either one of those values, in that case var arr = ['bat', 'ball']; var selectors = arr.map(function(val) { return ':contains(' + val + ')' }); var $lis = $('ul li').filter(selectors.join()); $lis.css('color', 'red')