Possible Duplicate:
Is It Possible to Sandbox JavaScript Running In the Browser?
I would like to give the user the ability to input JavaScript in a textarea like this:
<!DOCTYPE html>
<html>
<head>
<script>
function lapzwans()
{
var d = document.getElementById("area").value;
document.getElementById("blahblah").innerHTML = d;
}
</script>
</head>
<body>
<h1>Javascript in Javascript</h1>
<p>This experiment attempts to launch a script from another script.</p>
<p>Enter your script in the text area</p>
<textarea type="text" id="area"></textarea>
<button onclick="lapzwans()">Click here</button>
<p id="blahblah"></p>
<p id="deegroller">Make this text green</p>
</body>
</html>
I have tried this, but I get no result.
Is it impossible to do this, or am I doing things wrong?
Thanks in advance.