Question 1: Use .delegate
on the div to bind a click handler to the button.
Question 2: Use $(this).val()
or this.value
(the latter would be faster) inside of the click handler. this
will refer to the button.
$("#pg_menu_content").on('click', '#btn_a', function () {
alert($(this).val());
});
$div = $('<div data-role="fieldcontain"/>');
$("<input type='button' value='Dynamic Button' id='btn_a' />").appendTo($div.clone()).appendTo('#pg_menu_content');