0

I am new to jqmath; I have contained a textarea field in my HTML:

<textarea cols="30" rows="2" id="mathSrc1"></textarea>

I will set mathematical formula in the text area so that it will be displayed in <div> tag:

<div id="mathTgt1"></div>

This code is available in http://mathscribe.com/author/jqmath.html. But I don't know how to use it. Please help me.

Thank you.

Unheilig
  • 16,196
  • 193
  • 68
  • 98
Kavin
  • 183
  • 3
  • 13

2 Answers2

1

i got solution

<input type="textarea" name="formula" id="test_formula" onkeyup="paste_formula()" />
<span id="formula_print"></span>

script code

function paste_formula() {
var val = document.getElementById("test_formula").value;

val = "$$" + val + "$$";
var di = document.getElementById("formula_print");    

di.innerHTML = val;
M.parseMath(di);

}

Kavin
  • 183
  • 3
  • 13
0

I like Nathan's question - what exactly are you trying to do? The normal case is to have some math in your static web page, which you just surround with $s and it gets parsed and formatted at load time. If you want to create mathematical expressions dynamically (after load time), see Jqmath - apply after page load. You can also look at the jqmath source to see how http://mathscribe.com/author/jqmath.html does it. All these methods end up calling the same functions to do the actual work (parsing and formatting).

Community
  • 1
  • 1
Dave Barton
  • 1,429
  • 13
  • 12