Can I display superscript characters (not just numbers) in a dialog box alert(), confirm()or prompt()in JavaScript?
For some reason I need to insert text:
2 and then superscript 'n' 2 ^ n
In JavaScript alerts, confirmations and invitations. A quick Google search really helped, but I didn’t quite find a way to display superscript numbers in dialogs using the Unicode \ u00B character, but it does not work with characters
alert('2\u00B2'); shows correctly 2^2
alert('2\u00Bn'); shows 2u00Bn
So the goal is to show a symbol, not a number.
^ is used as Strength and shows that the next character is redefined, just in case someone gets confused.