<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>
'개발하자 > 자바스크립트' 카테고리의 다른 글
버튼이벤트 처리 3가지 방법 (0) | 2015.02.14 |
---|---|
함수호출 (0) | 2015.02.14 |
eval() (0) | 2015.02.14 |
trim() (공백이면 false 리턴) (0) | 2015.02.13 |
공백유무 (0) | 2015.02.12 |