eval() : eval : Global JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Global » eval »

 

eval()










Syntax








eval(command)
    eval(string)



The eval() function accepts a string of JavaScript statements and evaluates it as JavaScript source code.

eval() returns the value of the executed JavaScript statement.












<html>
    <body>
    <script lanuguage="JavaScript">

    <!--
    function run(){
         eval (document.form1.input1.value);
    }
    -->

    </script>
    <form name="form1">
    Enter a JavaScript command in the text field and click the "execute" button to execute the command.
    <br><br>
    Command:<input type="text" name="input1" size=30>
    <br>
    <input type="button" value="execute" onClick='run()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Global
» eval