Here's a code that I have
<button data-id="123">
Restore
</button>
function aButtonPressed(id){
alert(id);
}
$(document).ready(function() {
$('button').on('click', function(){aButtonPressed(data-id);});
});
I want the function to show in alert box string "123". How should I extract the data-id
?