Question

Is there a way how to render option in the select tag if options wrapped by "< >"?

<select>
    <option>First</option>
    <option><Second></option>
    <option>Third</option>
</select> 

http://jsfiddle.net/kn59m/

Was it helpful?

Solution

Yes, in HTML you need use &lt; to display < and similarly use &gt to display >

<select>
    <option>First</option>
    <option>&lt;Second&gt;</option>
    <option>Third</option>
</select> 

Demo: jsFiddle

here is full list of such special characters.

OTHER TIPS

<option>&lt;Second&gt;</option>

you can use like this

<option>&lt;Second&gt;</option>

You can escape special characters < and > using &#60; and &#62;:

<option>&#60;Second&#62;</option>

Fiddle Demo

Yes you can just use <option>&lt;Second&gt;</option>

See fiddle : JSFIDDLE

<select>
   <option>First</option>
   <option>&lt; Second &gt;</option>
   <option>Third</option>
</select> 

http://jsfiddle.net/jcferrans/Q637M/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top