JSFiddle - React, Tailwind, and code Playground
Used for Search&Promote
by happysmiles
HTML
<script src="http://silviomoreto.github.io/bootstrap-select/bootstrap-select.min.js"></script>
<link rel="stylesheet" href="http://silviomoreto.github.io/bootstrap-select/bootstrap-select.min.css">
<div class="col-md-6 col-sm-6 visible-xs">
<div class="filter">
<h3>Categories</h3>
<select class="facetselect selectpicker" multiple="multiple">
<option class="facetContentBodyLinkfacetid_content_g0_en_products_snp_wolc_jcr_content_filterContent_checkboxlist_0" data-facetquerystring="?i=1&q=*&q1=Products&view=xml&wcmmode=disabled&x1=page_category">Products</option>
<option class="facetContentBodyLinkfacetid_content_g0_en_products_snp_wolc_jcr_content_filterContent_checkboxlist_0" data-facetquerystring="?i=1&q=*&q1=News&view=xml&wcmmode=disabled&x1=page_category">News</option>
<option class="facetContentBodyLinkfacetid_content_g0_en_products_snp_wolc_jcr_content_filterContent_checkboxlist_0" data-facetquerystring="?i=1&q=*&q1=Industries&view=xml&wcmmode=disabled&x1=page_category">Industries</option>
<option class="facetContentBodyLinkfacetid_content_g0_en_products_snp_wolc_jcr_content_filterContent_checkboxlist_0" data-facetquerystring="?i=1&q=*&q1=Applications&view=xml&wcmmode=disabled&x1=page_category">Applications</option>
<option class="facetContentBodyLinkfacetid_content_g0_en_products_snp_wolc_jcr_content_filterContent_checkboxlist_0" data-facetquerystring="?i=1&q=*&q1=Encyclopedia&view=xml&wcmmode=disabled&x1=page_category">Encyclopedia</option>
<option class="facetContentBodyLinkfacetid_content_g0_en_products_snp_wolc_jcr_content_filterContent_checkboxlist_0" data-facetquerystring="?i=1&q=*&q1=Cases&view=xml&wcmmode=disabled&x1=page_category">Cases</option>
<option...
JavaScript
$('.dropdown-menu.selectpicker li').on('click', function () {
var index = $(this).data('original-index');
console.log(index);
var filterOptions = $(this).closest('.filter').find('select.facetselect.selectpicker option');
var selectedOption = filterOptions[index];
console.log($(selectedOption).data('facetquerystring'));
});