mathedit.newMath( id, parentId );
id: the id of a math expression. A new <embed> element with this id will be created.
parentId: the id of the element on which the above <embed> element will be appended.
Example:
<p id="newmath1"/> <input id="btn1" type="button" value="New Math Expression" onclick="mathedit.newMath( 'd1', 'newmath1' );" />
Click this button to create a new math expression here.
Your Entered Math Expression:
mathedit.editMathById( id );
id: the id of a math expression. If a non-exist math expression id is provided, an error message will pop up.
Example:
<input id="btn2" type="button" value="Edit Math Expression" onclick="mathedit.editMathById( 'd1' );" />
Click this button to edit the above math expression.
mathedit.get('mathContent');
Example:
<input id="btn3" type="button" value="Get MathML Content Code" onclick="mathedit.get('mathContent');" />
Click this button to get the Content code of math expression.
mathedit.get('mathInfix');
Example:
<input id="btn4" type="button" value="Get Infix Code" onclick="mathedit.get('mathInfix');" />
Click this button to get the Infix code of math expression.
mathedit.get('mathPresentation');
Example:
<input id="btn5" type="button" value="Get MathML Presentation Code" onclick="mathedit.get('mathPresentation');" />
Click this button to get the MathML Presentation code of math expression.
mathedit.editMath(Str,cType,tID,pID)
Str: the content code or infix code of a math expression.
cType: the type of code ('1':the content code;'2':infix code).
tID: the ID of a new math expression.
pID: the ID of target container(html element) which display math expression.
Example:
<p id="newmath2"/> <input id="btn6" type="button" value="Edit Math Expression" onclick="mathedit.editMath(document.getElementById('mcode').value,'1','d2','newmath2');" />
Please input math expression code(must be content code because the value of "cType" is '1'):
Click this button to edit math expression.
the Math Expression: