javascript – How can I add the "selected" attribute to an option when loading my page?

This is a small example, in the type of hidden entry I put the value of a mysqli query in this example would be in red, then in my selection there is the option in red, I want that when loading the page , compare the value of the entry with what there is in the selection there is match, the option corresponds to the selected attribute. If you could give me a pure javascript orientation, it would be very useful. I've tried the selectedOption () function but I can not make it work for me.




	
	
	Web page