Quantcast
Channel: User Ben Aston - Stack Overflow
Viewing all articles
Browse latest Browse all 56

Comment by Ben Aston on Is it possible to store a button value from a click event on a global variable using a callback function?

$
0
0
A callback function is only run when a button is pressed. In your first example, the console.log is evaluated before any button is pressed, and is therefore printing undefined.

Viewing all articles
Browse latest Browse all 56

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>