Adding Static Resources (css, JavaScript, Images) to Thymeleaf. We have enclosed this JavaScript in a getSelectedOptions function which returns an array of selected options: First, we need to set up the HTML for our demo. The following code gets the array of selected options using selectedOptions with the spread syntax (or Array.from()), and then map the