javascript - how can i automatically calculate an expression from a text field -


how can automatically calculate expression text field .. there function or thing ..

 <input type="text" value="3+4" id="txt">      var result = function_in_javascript(document.getelementbyid("txt").value)      alert(result )// 7 

try eval(document.getelementbyid("txt").value)

edit: though?


Comments

Popular posts from this blog

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -