javascript - capture MyScript Katex annotation encoding field for use elsewhere -


i new myscript , katex may dumb question. apologise if is. playing around idea, call newapp. want users able write formulae onto screen, myscript convert katex , display user can confirm understood correctly , send result newapp. in order check user's response in newapp i'm thinking best way send katex annotation encoding newapp think need doing through javascript don't know how pick katex. html katex following, depending on equation entered.

<div id="resultfield" class="style-scope myscript-math-web">  <span class="katex">   <span class="katex-mathml">    <math>     <semantics>      <mrow>       <mfrac>        <mrow>         <mn>2</mn>         <mn>1</mn>         <mo>−</mo>         <mn>3</mn>         <mn>5</mn>        </mrow>        <mrow>         <mn>1</mn>         <mn>3</mn>        </mrow>       </mfrac>       <annotation encoding="application/x-tex">\dfrac {21-35} {13}</annotation>             </semantics>     </math>    </span>   </span>  </div> 

i not know how started on javascript because within div created on hoof user writes there javascript approach allows me pick content of <annotation encoding="application/x-tex">\dfrac {21-35} {13}</annotation> within javascript.

any appreciated.

worked out - rather simple don't know why couldn't see morning.

<script>     function copy_result() {         elms = document.getelementbyid("resultfield").getelementsbytagname("annotation");         console.log(elms[0].innerhtml);     } </script> 

clearly console.log giving me result , should put somewhere useful


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -