Getting Data Attributes on Dynamically Created Select Lists using Javascript

I have a onchange function on my dynamically created select list which is trying to get the data- attributes but I am getting a "undefined" value. function changed_option(barcode,id,priceid,price){ var barcode=barcode; var record=id; var change_action = ( $(this).find(‘:selected’).data(‘change_action’)); var change_amount = ( $(this).find(‘:selected’).data(‘change_amount’)); alert("Change Action: "+change_action); alert("Change Amount: "+change_action); } The HTML generated code is: <select… Read More Getting Data Attributes on Dynamically Created Select Lists using Javascript