How to use methods in variables
奇遇
奇遇 2019-06-04 17:35:21
0
1
1060

<!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") };

//Solve How can I execute the ss() method

</script>

</body>

</html>

奇遇
奇遇

reply all(1)
angryTom

Just use the variable name plus parentheses to access it. You can use ass() directly

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template