Hi all,
Here is a simplified example of what I am trying to achieve. I have an HTML table that looks as follows:
<div class="data-table card">
<table>
<tbody>
<tr>
<td class="label-cell">Purchase price</td>
<td class="numeric-only" id="purchasePrice"></td>
</tr>
</tbody
</table>
</div>
When a button is clicked, a value is inserted into the table:
$$('.page-content').find('#buttonInsert').on('click', function (e) {
var amount= 5;
$$('.data-table #purchasePrice').html(amount);
});
What I would like to do is retrieve the inserted value from the table when another button further down on the page has been clicked. I have tried:
$$('.page-content').find('#buttonRetrieve').on('click', function (e) {
var value= $$('.data-table #purchasePrice').val();
console.log(value);
});
But the console is logging “undefined”. What am I doing wrong?