Hold down the control key on Windows or command key on Mac to select multiple options. Similarly, you can retrieve the selected values from multiple select boxes with a little trick. The index found before it can be used with this property to get the selected element. Keeping in mind what we stated above, we know that we can recover the index, the value or text. Now, we need to select the above elements by data attribute in JavaScript. Note: Returns null if the index number is out of range: namedItem(id) Returns the