I'm currently using HTML data attributes to display basic information when an element is clicked using $(this). For example, I have the following HTML snippet:
$('.element').on('click', function(e) {
e.stopPropagation();
$('#info').slideDown();
var title = $(this).data('title');
var desc = $(this).data('desc');
var icon = $(this).data('icon');
var info = $('#info');
info.html('<div class="sub-info"><h1>' + title + '</h1><h1 class="icon">' + icon + '</h1></div><div class="side-info"><p>' + desc + '</p></div>');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="element" data-title="title" data-desc="desc" data-icon="H">
It's working as intended but I need more information and keeping it in objects would be a lot cleaner I think. Could anyone point me in the right direction?