diff --git a/static/allowances.js b/static/allowances.js index 33bf1a0..42e9f2c 100644 --- a/static/allowances.js +++ b/static/allowances.js @@ -1,6 +1,11 @@ $(function() { $(".controls").hide(); - $(".name").click(function(e) { + $(".child").click(function(e) { $(this).next(".controls").toggle(); }); + $(".btn").click(function(e) { + var amount = $(this)[0].value; + var name = $(this).parent().parent().parent().prev().find(".name").text(); + console.log(name + " " + amount); + }); }); diff --git a/templates/index.html b/templates/index.html index a4c0ab9..81717c9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,13 +16,9 @@ {{ range .children }} - - - {{ .Name }} - - - {{ dollarize .Money }} - + + {{ .Name }} + {{ dollarize .Money }}