Adding Javascript superscript and subscript functionality