http://html.templines.com/sokolcov/auto-club/listTableTwo.html
I purchased a template(Bootstrap 3)… well in this demo page ^^^ … you know how - when coming from a page back … from a Toyota car… the SELECT A MAKE drop down menu have pre-select toyota… currently when coming “Any Make” is selected… the default…
code in editor
<div class="b-items__aside-main-body-item"> <label>SELECT A MAKE</label> <div> <select name="select1" class="m-select" id="makeId"> <option value="" selected="">Any Make</option> </select> <span class="fa fa-caret-down"></span> </div> </div>
chrome gen code
<div class="b-items__aside-main-body-item">
<label>SELECT A MAKE</label>
<div>
<select name="select1" class="m-select" id="makeId"><option value="" selected="selected">Any Make</option><option value="4590">AC COBRA MKIII</option>
<option value="7056">ACCESSORIES</option>
<option value="7405">ACCIDENT CARS </option>
<option value="5530">AEON</option>
<option value="1">ALFA ROMEO</option>
<option value="5018">APRILIA</option>
<option value="101">ASTON MARTIN</option>
<option value="6060">ATV</option>
.............................
.............................
<option value="6280">ZHWEKI</option>
<option value="5180">ZNEN</option>
<option value="5111">[TRAILER]</option></select>
<span class="fa fa-caret-down"></span>
</div>
</div>
tried…
sessionStorage.getItem(“CarID”) = 3 ,
sessionStorage.getItem(“CarBrand”) =“BMW”
any hint how this template’s drop down can modified…?
// tried
$("select#makeId option").each(function () {
if ($(this).html() == sessionStorage.getItem("CarBrand") ) {
$(this).attr("selected", "selected");
return;
}
});
$("select#makeId option").each(function () {
if ($(this).attr("value") == sessionStorage.getItem("CarID") ) {
$(this).attr("selected", "selected");
return;
}
});
// also tried
$("#makeId").prepend('<option value="'+makeId+'" selected="selected">'+makeBrand+'</option>')