From 6fd7fd650e6a7cd8a48819f7f247c17c945bf48c Mon Sep 17 00:00:00 2001 From: gengi Date: Wed, 2 Sep 2015 20:37:38 -0400 Subject: [PATCH] bug fixed --- main.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/main.js b/main.js index c59af61..045da86 100644 --- a/main.js +++ b/main.js @@ -1,10 +1,16 @@ $(function(){ - var oneUp = function(){ - num++; - }; - var printNum = function(){ - var num = 0; - $('#output').html(num); - }; - printNum(); + + var num = 0; + + var oneUp = function(){ + num++; + printNum(); + }; + + var printNum = function(){ + $('#output').html(num); + }; + + $('#my-button').click(oneUp); + printNum(); }); \ No newline at end of file