개발하자/자바스크립트
eval() 로 함수호출
i구야
2015. 2. 14. 10:19
<html>
<script>
function a(){alert(111);}
function b(){alert(222);}
</script>
<body>
<input type=text id=f>
<input type=button value=함수호출 onclick=eval(f.value+"()")>
</body>
</html>
<script>
function a(){alert(111);}
function b(){alert(222);}
</script>
<body>
<input type=text id=f>
<input type=button value=함수호출 onclick=eval(f.value+"()")>
</body>
</html>