How to Use HTML Tags in the Options For Select Elements

Can I use HTML tags in the options for select elements?

No, you can't do this. <option> tags cannot contain any other tags.

How to write html code in option tag of select tag?

You can't. <option> elements aren't allowed any other elements as children, they have Content model: Text.

The closest you could come would be to use something other than a <select>, put radio buttons inside it instead of <option>, and add a pile of JavaScript and CSS to add the drop down effect and make it look like a select.

How to put table tag inside a option tag of select tag in HTML?

Change select for radio type and use tables, or use a css to simulate a table.

How to style the option of an html select element?

There are only a few style attributes that can be applied to an <option> element.

This is because this type of element is an example of a "replaced element". They are OS-dependent and are not part of the HTML/browser. It cannot be styled via CSS.

There are replacement plug-ins/libraries that look like a <select> but are actually composed of regular HTML elements that CAN be styled.

Select an option in a select element with tag helpers

You're not doing anything with the asp-for. It's not magic. If you look at the code for one of the built-in tag helpers, you'll see they have property for capturing this, along the lines of:

[HtmlAttributeName("asp-for")]
public ModelExpression For { get; set; }

Then, you must use this property to actually set the selected option by reading the value. That said, though, you'd probably be better served by simply inheriting your tag helper from SelectTagHelper, and just overriding Process to do your own logic. Remember to call base.Process as well, though.

Style option tag HTML

There is limited styling capability for <option>, as this element is an Operating System element. For better styling of <option> use plugins. For example this plugin (jquery is required). But you can style the selected element in this way - option[selected]. I have provided some examples of how you can style your <option>. Perhaps these are not all possible options.

 #from_currency{ 
background-color: blue;
color: green;
}

#from_currency2{
font-size: 120%;
width: 100%;
}

#from_currency3 option[selected]{
background-color: green;
}
<select id="from_currency" >
<option value="AED">AED</option>
<option value="ARS">ARS</option>
<option value="AUD">AUD</option>
<option value="BGN">BGN</option>
<option value="BRL">BRL</option>
</select>

<select id="from_currency2" >
<option value="AED">AED</option>
<option value="ARS">ARS</option>
<option value="AUD">AUD</option>
<option value="BGN">BGN</option>
<option value="BRL">BRL</option>
</select>

<select id="from_currency3" >
<option value="AED">AED</option>
<option value="ARS">ARS</option>
<option value="AUD" selected>AUD</option>
<option value="BGN">BGN</option>
<option value="BRL">BRL</option>
</select>

Get select option including HTML element using jQuery

Access outerHTML property

var optionStr = '';
$('#myArea option').each(function() {
optionStr += this.outerHTML;
});