Topic: Multiple Select, Mark selected items on page load
Ronald Patino asked 8 years ago
Ronald Patino answered 8 years ago
Adrian Sawicki answered 8 years ago
<select class="mdb-select" multiple>
<option value="" disabled selected>Choose your option</option>
<option value="1" class="active selected">Option 1</option>
<option value="2" class="active selected">Option 2</option>
<option value="3" class="active selected">Option 3</option>
</select>
<label>Example label</label>
JS:
$(document).ready(function() {
$('.mdb-select').material_select();
var x = $('.dropdown-content').find('li');
for(let i = 1; i <= 4; i++) {
x.eq(i).trigger('click');
}
$('body').trigger('click');
});
Ronald Patino answered 8 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Free
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No