You could do this:
onclick="getValue2("' + parameter + '")"
But something like this would be better:
var $div = $('');
var $button = $('')
.data('parameter', parameter)
.click(function () {
getValue2($(this).data('parameter'));
}).appendTo($div);
$("#content").append($div);