How to implement eval in javascript.
<script>
function fun1()
{
x="100*4+50"
alert(eval(x))
}
</script>
<body>
<input type="button" value="lets get it on" onclick="fun1()">
</body>
<script>
function fun1()
{
x="100*4+50"
alert(eval(x))
}
</script>
<body>
<input type="button" value="lets get it on" onclick="fun1()">
</body>
0 comments: