jamesadrian 0 Posted August 9 Report Share Posted August 9 I'm trying to write an article on my web site about special relativity. Does HTML5 provide a way to render one over the square root of an expression on a web page? The expression has superscripts and subscripts, which I know how to do. Thank you for your help. Jim Adrian Quote Link to post Share on other sites

JMRKER 10 Posted August 9 Report Share Posted August 9 See if you can use this: <script> const recpSqrt = (value) => { return 1/(Math.sqrt(value)); } var v = 2; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v)); v = 3; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v)); v = 4; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v)); v = 5; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v)); </script> Quote Link to post Share on other sites

Ingolme 1,016 Posted August 10 Report Share Posted August 10 Wikipedia and other sources use images to represent mathematical expressions on a page. HTML is not well equipped to represent them. There is an XML-based language called MathML, but it is not well supported by browsers. Quote Link to post Share on other sites

## Recommended Posts

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.