I do it like so … (for digits)
I select the digit that I would like to superscript
In MacOS, I launch the Character Viewer
I use the search function available in the Character Viewer window and search for superscript
From the search results, I double click the character I want to replace the selection I made in step 1 and the selected text is now replaced by what I double clicked on
As a tip, you can pretty much double click on most anything inside the character viewer and it will "type" into the text block. I might be worth your while to inspect the element using the browser inspector to learn what is going on behind the scenes as it were. I would also test the results by viewing the contents in a variety of browsers to understand any limitations that might not be obvious.