giwuf,
алгоритм зависимых селектов: функция в строке 14
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script>
window.addEventListener("DOMContentLoaded", function() {
var select = document.querySelector(".sf-input-select"),
opt = [].slice.call(select.options, 0);
function optShow(cls) {
opt.forEach(function(option, i) {
var parent = option.parentNode;
if (option.classList.contains(cls) || !i) {
select.appendChild(option);
} else {
if (parent) {
parent.removeChild(option);
}
}
});
}
optShow("sf-level-0"); // optShow("sf-level-1") или optShow("")
});
</script>
</head>
<body>
<li class="sf-field-taxonomy-ad_cat" data-sf-field-name="_sft_ad_cat" data-sf-field-type="taxonomy" data-sf-field-input-type="select" data-sf-combobox="1" data-sf-term-rewrite="["http:\/\/autogid\/ad-category\/[0]\/","http:\/\/autogid\/ad-category\/[0]\/[1]\/"]">
<label>
<select data-combobox="1" name="_sft_ad_cat[]" class="sf-input-select" title="" style="">
<option class="sf-level-0 sf-item-0 sf-option-active" selected="selected" data-sf-count="0" data-sf-depth="0" value="">марка а/м</option>
<option class="sf-level-0 sf-item-32" data-sf-count="1" data-sf-depth="0" value="alfa-romeo">Alfa Romeo</option>
<option class="sf-level-0 sf-item-19" data-sf-count="10" data-sf-depth="0" value="audi">Audi</option>
<option class="sf-level-1 sf-item-39" data-sf-count="1" data-sf-depth="1" value="a6c5"> A6C5</option>
</select>
<div class="chosen-container chosen-container-single" style="width: 170px;" title="">
<a class="chosen-single"><span>марка а/м</span><div><b></b></div></a>
<div class="chosen-drop">
<div class="chosen-search"><input type="text" autocomplete="off"></div>
<ul class="chosen-results">
<li class="active-result result-selected sf-level-0 sf-item-0 sf-option-active" data-option-array-index="0">марка а/м</li>
<li class="active-result sf-level-0 sf-item-32" data-option-array-index="1">Alfa Romeo</li>
<li class="active-result sf-level-0 sf-item-19" data-option-array-index="2">Audi</li>
<li class="active-result sf-level-1 sf-item-39" data-option-array-index="3"> A6C5</li>
</ul>
</div>
</div>
</label>
</li>
</body>
</html>