An accent command puts a mark over its argument: \hat{x}, \bar{x}, \vec{v}, \dot{x}, \tilde{a}. Step 11 of 17 of the LaTeX tutorial, editable as you read it.
Render a LaTeX or mhchem formula as an SVG or PNG image, learn the notation step by step, and practise it with graded exercises. The tool itself needs JavaScript; the rendering API does not.