How can I add elements to tag

How can I add elements to tag

Hi, I'm trying to generate a 'a' tag with some parameters to call a function which makes a rest call, 

    divHTMLPages = "<a href='#' onclick='getRestResults(" + $('#queryU').val() + "', '" + _reg + "', " + _rowLimit + ", " + previousPageCount + ")'>" + i + "</a> ";

$('#pageU').html(divHTMLPages);

But the result is not well-formed I see double quotes after getting #queryU.val() and that's not correct, what would be the correct form for doing this? I have read about jQuery .add but not sure this is the best approach. Any help would be really appreciated. Thanks in advance.