In most common configs, if your ouput is not directly mathML, mathjax stores mathml informations in the attribute data-mathml
of a span tag wich wraps the mathJax element
This is what is displayed in the popup when you right click on a mathJax element : show math as -> MathMl Code
If your goal is to grab equations from html in mathml format, you can create a script which parse your document and get all data-mathml attributes.
There is many ways to achieve that, this is just an example you may have to adapt:
function grabMathMl(){
var spanMathMl = document.querySelectorAll(".MathJax");
let results = [];
let i = 0, ln = spanMathMl.length;
for ( i; i < ln; ++i){
if ( spanMathMl[i].hasAttribute("data-mathml") ){
results.push(spanMathMl[i].dataset.mathml);
// if you really want to replace content
spanMathMl[i].innerHTML = "<textarea>"+spanMathMl[i].dataset.mathml+"</textarea>";
}
}
return results;
}
// put this fonction in the mathJax queue for you have to wait until mathJax process is done
MathJax.Hub.Queue(function(){
let equations = grabMathMl();
//console.log (equations.toString());// your equations in mathml
});
<script>
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<div>$$\left|\int_a^b fg\right| \leq \left(\int_a^b
f^2\right)^{1/2}\left(\int_a^b g^2\right)^{1/2}.$$</div>
<div>
\begin{equation} x+1\over\sqrt{1-x^2} \end{equation}
</div>
Then in word, this link should interest you
https://superuser.com/questions/340650/type-math-formulas-in-microsoft-word-the-latex-way#802093