How can I format a typical Input with type="button"
to display content text having a subscript format?
Example: O2
For that particular example you could just use Unicode code point U+2082:
<input type="button" value="O₂">
… but in the general case the solution is stop using an input. HTML 4 introduced the <button>
element to replace the submit, button and reset types.
<button>
has two main advantages:
<button type="button"> O<sub>2</sub> </button>