Hi
Please refer to this documentation :- https://docs.adobe.com/docs/en/aem/6-1/ref/coral-ui/docs/2.17.0-granite-004/select.html
//
Responding to User Interaction
The following shows how to respond to user interaction when an item is selected in the Select component above.
<script>
$(document).ready(function () {
var eventLog = $('#selectLog');
$('#mySelect').on('selected', function(event) {
eventLog.log('Value ' + event.selected + ' selected.');
});
});
</script>
Programmatically setting a selection
The following shows how to programmatically set the selected options in the Select component above
<script>
function selectBermuda() {
var select = $('#mySelect').data('select');
select.setValue('bm');
};
function selectAll() {
var select = $('#mySelect').data('select');
select.setValue(['bm', 'cm', 'dk', 'ec']);
};
function deselectAll() {
var select = $('#mySelect').data('select');
select.setValue();
};
</script>
I hope this would help you.
Thanks and regards
Kautuk Sahni
Kautuk Sahni