I am trying to setup a page which contains an HTML table. You would be able to click on any row on the table to pull up a modal with a different image. The image URLs will be stored as data-ids in the tags as I must do all of this in a browser and have no sever to make calls to.
I have the following code to setup my modal. By itself, $(this).data('chi') gets the data-chi id which is the image url. How do I use that within the HTML inside the .html() jQuery method? I tried various escapes but cannot figure it out.
$('#orderDetails').html($("<b> Order Id selected: <img src=\'\$(this).data('chi')\' alt=\"Smiley face\">" + '</b>'));
$('#orderModal').modal('show');
Link to JSFiddle - https://jsfiddle.net/rHHmz/171/