jamesadrian Posted August 9, 2020 Posted August 9, 2020 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
JMRKER Posted August 9, 2020 Posted August 9, 2020 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>
Ingolme Posted August 10, 2020 Posted August 10, 2020 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now