CSS
.info { display:none; background: rgba(0,0,0,.4); width: 400px; height: 100px; margin: 50px auto; padding: 15px;}
.button {width: 40px; height: 20px; background:red; cursor:pointer;}
.jj {width: 120px; height: 80px; background:gray; color:white; cursor:pointer;}
JS
function done(a, b, c,d) {
$(".info-holder").append("<div class='jj' >" + a + "<div>");
$(".info-holder").append("<div class='jj' >" + c + "<div>");
$(document).on("click",".jj", function() {
$('div.info').html(' name : '+ $(this).html() + 'age : ' +$(this).html() );
$('div.info').fadeIn();
});
};
HTML
<div class="button" onclick="done('david',33, 'john', 44)">click</div>
<div class="info-holder"></div>
<div class="info"></div>
This is the code , i don't know how to access to that two variables ,it maybe looks messy but this is not my real code , i just explain my problem , so please if someone know how to access to those variables that way , show me .