Kenuat,
что не работает то?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>buttonMarkup demo</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div class="ui-widget">
<div id="divtest"><button>Edit</button></div>
</div>
<script>
$("#divtest").append(edit_button(1));
function edit_button(id) {
var btnEdit = $('<button>Edit</button> ').click(function () {
alert('edit ' + id);
});
return btnEdit;
}
</script>
</body>
</html>