>  Q&A  >  본문

변수에서 메소드를 사용하는 방법

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>ajax</title>

</head> ;

<body>

<button onclick="ass.ss()">execute</button>

<script>

var ass = function ss() { Alert("hello" ) };

//ss() 메소드 실행 방법 해결

</script>

</body>

</html>

奇遇奇遇1964일 전1031

모든 응답(1)나는 대답할 것이다

  • angryTom

    angryTom2019-07-15 11:46:22

    변수 이름과 괄호를 사용하여 액세스하세요. ass()를 직접 사용할 수 있습니다

    회신하다
    0
  • 취소회신하다