Superscript I’m AppLab

I am trying to make an app for my students to practice factoring polynomials but I’m struggling to get an x squared to show up properly formatted. How can I make a label contain a superscript?

Link to the project or level: Code.org - App Lab

What I expect to happen: I want to be able to write a variable with an exponent (superscript)

What actually happens: I can’t format the text in any way besides color,size,etc.

@lcescocancian

Good question! I searched on google how to type a superscript 2 in javascript and found the following javascript function… 178 is the char code for the superscript 2, so this should work!

String.fromCharCode(178)

Mike

That’s it!! thank you so much!