How to return value from addEventListener
问题 I use a javascript to catch the x and y position when user click a link, by now, I can make it works, but I want it to return the two values to function init() when it is called. How can I do it? <script type="text/javascript"> document.addEventListener("DOMContentLoaded", init, false); function init() { var canvas = document.getElementById("canvas"); canvas.addEventListener("mousedown", getPosition, false); // how can I get the return values here? } function getPosition(event) { var x = new