picking off names/values of buttons (there must be a better way)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user