Does anyone know how to get the value of a custom attribute "custom" from a select multiple? I think you would get an array by selecting several elements
<select class="selectpicker" multiple>
<option custom="Mustolest">Mustard</option>
<option custom="Kellared">Ketchup</option>
<option custom="Reloaded">Relish</option>
</select>
I'm using bootstrap select. What I have tried is the following:
$(function() {
$('.selectpicker').selectpicker();
$('.selectpicker').on("change",function() {
console.log($('.selectpicker').selectpicker("val"));
});
})
With this I get the values in the form of an array, correct. But I need to get over a custom attribute. The options that you have given me would not be working for me.