I want to create a JavaScript Command Execution .. I mean, if I build up a page, with an input method, then, the value of that input method is executed in the JavaScript console, then, the result of that execution should be inserted in an HTML tag as: HTML:
<input id="commandInsertion"/>
<input type="Submit" onclick="doCommand()">
<p id="result"></p>
JavaScript:
var doCommand = function(x) {
// The command should be something like this
Execute(x); // Imaginary Function
document.getElementById('result').innerHTML = ResultOf(x);
// ResultOf() is also an imaginary function
};
doCommand
is a function that executes a command and then, prints it into the document