Since you are clicking on the dynamically added element, you can store the itemvalue
as data to the element
Ex
jQuery(function($){
$('input[name=namea]').change(function(){
var itemvalue = this.value;
var pa = $('<p />', {
class: 'pa',
html: 'Blah blah ' + itemvalue + 'blah blah.'
}).data('itemvalue', itemvalue).data('otherdata', 'othervalue')
$('#diva').prepend(pa);
});
$('#diva').on('click', '.pa', function() {
alert($(this).data('itemvalue'))
alert($(this).data('otherdata'))
})
})
It will give the values of itemvalue
n time back
Demo: Fiddle