Do I have to iterate through ALL the and set remove the \'selected\' attribute or is there a better way?
You can pass an empty array to unselect all the selection. Here goes an example. From documentation
val()allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like , , and s inside of a . In this case, the inputs and the options having a value that matches one of the elements of the array will be checked or selected while those having a value that doesn't match one of the elements of the array will be unchecked or unselected, depending on the type.
$('.clearAll').on('click', function() {
$('.dropdown').val([]);
});