Hello everybody,
I have this small ajax script that pulls in information from the database and displays on a page:
> success: function(response){
> if($.trim(response) != 'noRecord' || response == $.trim('Failed')){
> var dateClosed;
> var table = '<table><tr><th>item</th><th>Version</th><th>Date</th><th>Status</th><th></th></tr>';
> $.each(JSON.parse(response), function(key, value){
> if(value.ver_closedDate != '0000-00-00 00:00:00') {
> dateClosed ='closed'; } // project closed
> else { dateClosed ='Open'; } //if project still open
> table += ('<tr>');
> table += ('<td>' + value.ver_projectID + '</td>');
> table += ('<td>' + value.ver_version + '</td>');
> table += ('<td>' + value.ver_startDate + '</td>');
> table += ('<td>' + dateClosed + '</td>');
> table += ('<td> <button id="popup111" value="'+ value.ver_projectID + '" >Close</button></td>');
> table += ('</tr>');
> });
$(‘#ListRecord’).html(table); // displays the above content
after the record is displayed how can I access the value of the button when the user click the button?
tried the following with no success:
$("#popup111").click(function(){
// event.preventDefault();
var butValue = $('#popup111').val();
alert("Button value"+ butValue);
});
any ideas?