Here is a fiddle showcasing the concept I am working on: https://jsfiddle.net/wvz9p3e7/1/
The code is written in PHP and involves a loop for cycling through 7 or 8 different garments. My goal is to have the window on the right side of the fiddle display the correct Garment Id and Base Price when one of the boxes is clicked.
I have successfully implemented the garment ID functionality, but now I am struggling with how to make JavaScript find the base price and populate the text on the right-hand side.
$(document).ready(function() {
$(".garment-select").click(function(event) {
$("#garmentID").text(event.target.id);
$(".garment-select").not(this).removeClass('selectecGarment');
$(this).toggleClass( "selectecGarment" );
});
$(".garmentPanel > .").click(function(event) {
$("#garmentID").text(event.target.id);
});
});