JSFiddle - React, Tailwind, and code Playground
HTML
<ul>
<li class="randomnumber">result 1</li>
<li class="randomnumber">result 2</li>
<li class="randomnumber">result 3</li>
</ul>
JavaScript
$(function () {
$('.randomnumber').click(function () {
var $this = $(this);
$this.data('id', $this.data('id') || Math.floor(100000 + Math.random() * 900000));
alert( $this.data('id') );
});
});