I am having trouble displaying additional data in a table when a specific row is clicked. Here is the table structure I am working with:
<div id="display">
<div class="displayRow">
<img src="images/expand-arrow.gif" class="expandArrow" alt="expand">
<div class="displayElement">1</div>
<div class="displayElement">Standard</div>
<div class="displayElement">This is more information</div>
</div>
<div class="displayRow">
<img src="images/expand-arrow.gif" class="expandArrow" alt="expand">
<div class="displayElement">2</div>
<div class="displayElement">Special</div>
<div class="displayElement">This is more information</div>
</div>
</div>
I have been experimenting with the following code but haven't been successful in achieving the desired outcome. Can anyone provide guidance or assistance? Thank you!
Here is the code snippet I have been working on:
$(".expandArrow").on("click", function (event) {
var details = '';
details += '<div><table class="detailTable">';
details += '<tr><td>DisplayElement1</td><td>' + json.Id + '</td></tr>';
details += '<tr><td>Display Element2</td><td>' + json.Info + '</td></tr>';
details += '</table></div>';
$(this).parent().append(details);
});