add selected attribute to option javascript

My problem is that I want to be able to select any row and add (select a color) attribute to it. Students' perspective on lecturer: To what extent is it credible? Tip: The selected attribute can also be set after the page loads, with a JavaScript. You can set the initial state with the SELECTED attribute, while the selected property contains the actual state of the option. Was the storming of the US Capitol orchestrated by Antifa and BLM Organisers? Note: If no option is selected, the selectedIndex property will return -1. My problem is that I want to be able to select any row and add (select a color) attribute to it. Asking for help, clarification, or responding to other answers. The shorter version will be displayed in the drop-down list. Note: The Note: This attribute can be used only on