How to represent this superscript?

I am trying to write this command below but it doesnt work.

Code:

\documentclass[fleqn]{article}
\usepackage{amsmath}

\begin{document}
Inline math: $\triangle^m \quad \triangle_m$
%
$\text{Display math:}\quad \triangle^m \quad \triangle_m$
%
If the entire term is to be super or sub script:
$\text{Display math:}\quad x_{\triangle^m} \quad x_{\triangle_m}$
\end{document}

-
• If you want to produce an dollar sign followed by a triangle followed by a dollar sign followed by a superscript m, the correct syntax is $\$\triangle\$^m$.
• If you want to produce a subscript triangle and a superscript m, the correct syntax is ${}_\triangle^m$.
-