picking off names/values of buttons (there must be a better way)
This commit is contained in:
parent
a74c5bb8bb
commit
fe0411e8df
@ -1,6 +1,11 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
$(".controls").hide();
|
$(".controls").hide();
|
||||||
$(".name").click(function(e) {
|
$(".child").click(function(e) {
|
||||||
$(this).next(".controls").toggle();
|
$(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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -16,13 +16,9 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{ range .children }}
|
{{ range .children }}
|
||||||
<tr class="name">
|
<tr class="child">
|
||||||
<td>
|
<td class="name">{{ .Name }}</td>
|
||||||
{{ .Name }}
|
<td>{{ dollarize .Money }}</td>
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ dollarize .Money }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="controls">
|
<tr class="controls">
|
||||||
<td colspan=2 style="text-align: center;">
|
<td colspan=2 style="text-align: center;">
|
||||||
|
Loading…
Reference in New Issue
Block a user