I prefer to use the HTML5 data API, check this documentation:
$('#some-list li').click(function() {_x000D_
var textLoaded = 'Loading element with id='_x000D_
+ $(this).data('id');_x000D_
$('#loading-content').text(textLoaded);_x000D_
});
_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>_x000D_
<ul id='some-list'>_x000D_
<li data-id='1'>One </li>_x000D_
<li data-id='2'>Two </li>_x000D_
<!-- ... more li -->_x000D_
<li data-id='n'>Other</li>_x000D_
</ul>_x000D_
_x000D_
<h1 id='loading-content'></h1>
_x000D_