JSFiddle - React, Tailwind, and code Playground
HTML
<div class="myDiv"></div>
JavaScript
var your_user_id = 1,
your_course_name = 'what ever',
your_url = 'nice url';
var genGroups = function(params){
alert(params.userId);
alert(params.coursename);
alert(params.url);
};
// create a new empty link
var $myDiv = $('.myDiv'),
$newLink = $('<a>');
// to store your meta properties as html data
$newLink.data({
'userId':your_user_id,
'coursename':your_course_name,
'url':your_url
}).text(your_course_name);
// append the new link
$myDiv.append($newLink);
// bind the click event anywhere in your code
$myDiv .on( 'click','a', function() {
var linkData = $(this).data();
genGroups( linkData );
});